-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
checksrc: repair the copyrightyear check #4549
Conversation
The problem showed up with |
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.
LGTM, thanks
f029020
to
54d5e27
Compare
I haven't investigated exactly why, but when fixing this problem and reran I will fix these by updating their ranges to I also think we need to put back the copyright year check in the CI to catch these earlier. |
IIRC (with a disclaimer on the c part), the COPYRIGHTYEAR check only runs when explicitly invoked or when in maintainer mode. It seems quite likely that these snuck through on patches which were developed outside of maintainer mode, perhaps trivial PRs which didn't end up being massaged in a maintainer tree where it would've been caught.
I guess we could add logic to COPYRIGHTYEAR to cope with fixup commits like this one, but I doubt it's worth the effort.
It was removed as it was "yelling at contributors" too much, causing red builds everywhere. We could shift the responsibility to the committer and not the contributor but it won't fix the red build. Not sure how to best tackle that. |
Yeah, and that's probably still the case. I should probably be fine with having |
Now this is really curious. This travis build warnings say the commit year is 2019 while it clearly is 2018 for several files (for example |
That's borderline bizarre. Since I assume that Travis isn't screwing around in the |
Are you working on a fresh checkout/clone? Git normally creates files with the current date on checkout and does not care about filesystem timestamps at all. |
On 5 Nov 2019, at 12:39, Marc Hörsken ***@***.***> wrote:
Are you working on a fresh checkout/clone? Git normally creates files with the current date on checkout and does not care about filesystem timestamps at all.
The check inspects the commit timestamp, not the file timestamp.
|
hm
yet the checksrc debug output shows:
edit: super weird how all the bad ones seem to be |
3d4a6ac
to
cba44f5
Compare
I added a commit and the CI results for it show the same weird nonsense BUT this time with |
I ran this command which should show the file history in reverse chronological order but instead it just shows one entry:
12063.1: none of this makes any sense. each one of those commits is a direct descendant of the prior one and have nothing to do with that file. |
I think I understand what's happening. Travis uses a truncated history on clone:
hm:
repro:
It appears if there are files that have not been modified in the truncated history then git returns the first commit it has. I put in a commit that does it let's see what happens... |
Aha! How silly that it took that long to figure out! Good catch there @jay!
|
- Consider a modified file to be committed this year. - Make the travis CHECKSRC also do COPYRIGHTYEAR scan. - Ignore 0 parents when getting latest commit date of file. since in the CI we're dealing with a truncated repo of last 50 commits, the file's most recent commit may not be available. when this happens git log and rev-list show the initial commit (ie first commit not to be truncated) but that's incorrect so ignore it. Ref: #4547 Closes #4549
99aa1db
to
2762efd
Compare
I've squashed your commits into 2, if it passes we should be done. |
Also for future reference if that didn't work my next step would've been to ssh into travis during the build (looks neat). |
Right, this fix should make the build on travis happy. But I'm still not convinced we should add this copyright check to the travis build for the same reasons as before: it causes a great deal of (surprise) complaints on PRs for users. My intent was just to make sure that it works on travis and then not push it but only run these checks in my local builds. |
Ok np I'll leave it to you to wrap up. |
I will let the copyrightyear scan be enabled in include/curl and docs/examples for now to see if that's a good idea ... |
- Consider a modified file to be committed this year. - Make the travis CHECKSRC also do COPYRIGHTYEAR scan in examples and includes - Ignore 0 parents when getting latest commit date of file. since in the CI we're dealing with a truncated repo of last 50 commits, the file's most recent commit may not be available. when this happens git log and rev-list show the initial commit (ie first commit not to be truncated) but that's incorrect so ignore it. Ref: #4547 Closes #4549 Co-authored-by: Jay Satiro
I'm not sure why or how, but checksrc's copyrightyear check has stopped working and it seems to be because current git doesn't show the commit date for the commands used. #4547 made me realize.
This patch brings back the warnings for me. Please give it a look @danielgustafsson!