New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
contrib/utilities/update-copyright.sh: several improvements #16689
Conversation
566b423
to
19e016c
Compare
19e016c
to
d034789
Compare
31319d3
to
22a3452
Compare
22a3452
to
8f582bf
Compare
- make lookup of last modification year more robust - add a --pedantic mode that greps the first year a file was modified from git log - restructure processing into a separate bash function and add parallel processing structure - run script on all files of the repository
8f582bf
to
add8119
Compare
@masterleinad I will run this script tomorrow on the header branch and verify that this indeed fixes all date ranges. |
@tjhei ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but, wow, what a complex machinery you have built.
# full history: | ||
# | ||
|
||
[ -z "$last_year" ] && last_year=`git log --date=short --format="format:%cd %s" ${file} | \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why didn't you just write this as if test -z "$last_year" ; then ...
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really purely a stylistic choice:
test
and[
are the same shell built-in. And[ -z ... ]
looks better thantest -z ...
. I should have probably used the extended test pattern[[ ... ]]
consistently...- I tend to use the
[[ ... ]] && VARIABLE="..."
a lot for simple conditional variable assignments. That's somewhat a bash coding style coming from Gentoo ebuilds. But yes, we could have used anif
statement as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. It's perhaps a bit harder to read, but I'm ok with the stylistic choice.
Separated from #16686 to facilitate easier review.