[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 10/151: checksrc: repair the copyrightyear check
From: |
gnunet |
Subject: |
[gnurl] 10/151: checksrc: repair the copyrightyear check |
Date: |
Fri, 20 Dec 2019 14:25:19 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 1f73138ce1272ea52c9b0119f5ef67aed28af836
Author: Daniel Stenberg <address@hidden>
AuthorDate: Fri Nov 1 13:58:27 2019 +0100
checksrc: repair the copyrightyear check
- 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: https://github.com/curl/curl/pull/4547
Closes https://github.com/curl/curl/pull/4549
Co-authored-by: Jay Satiro
---
.travis.yml | 2 ++
lib/checksrc.pl | 13 +++++++++----
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 3c4fb43e5..73ac0fb01 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -609,6 +609,8 @@ script:
make test-nonflaky
fi
if [ -n $CHECKSRC ]; then
+ echo "enable COPYRIGHTYEAR" > ./docs/examples/.checksrc
+ echo "enable COPYRIGHTYEAR" > ./include/curl/.checksrc
make checksrc
fi
fi
diff --git a/lib/checksrc.pl b/lib/checksrc.pl
index b2cfa8355..834364561 100755
--- a/lib/checksrc.pl
+++ b/lib/checksrc.pl
@@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 2011 - 2018, Daniel Stenberg, <address@hidden>, et al.
+# Copyright (C) 2011 - 2019, Daniel Stenberg, <address@hidden>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -717,12 +717,17 @@ sub scanfile {
my $commityear = undef;
@copyright = sort {$$b{year} cmp $$a{year}} @copyright;
+ # if the file is modified, assume commit year this year
if(`git status -s -- $file` =~ /^ [MARCU]/) {
$commityear = (localtime(time))[5] + 1900;
}
- elsif (`git rev-list --count origin/master..HEAD -- $file` !~ /^0/) {
- my $grl = `git rev-list --max-count=1 --timestamp HEAD -- $file`;
- $commityear = (localtime((split(/ /, $grl))[0]))[5] + 1900;
+ else {
+ # min-parents=1 to ignore wrong initial commit in truncated repos
+ my $grl = `git rev-list --max-count=1 --min-parents=1 --timestamp
HEAD -- $file`;
+ if($grl) {
+ chomp $grl;
+ $commityear = (localtime((split(/ /, $grl))[0]))[5] + 1900;
+ }
}
if(defined($commityear) && scalar(@copyright) &&
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] branch master updated (70745a841 -> 486ada36f), gnunet, 2019/12/20
- [gnurl] 02/151: build: fix for CURL_DISABLE_DOH, gnunet, 2019/12/20
- [gnurl] 06/151: mailmap: fixup Massimiliano Fantuzzi, gnunet, 2019/12/20
- [gnurl] 05/151: scripts/contributors: make committers get included too, gnunet, 2019/12/20
- [gnurl] 04/151: configure: fix typo in help text, gnunet, 2019/12/20
- [gnurl] 10/151: checksrc: repair the copyrightyear check,
gnunet <=
- [gnurl] 11/151: test1560: require IPv6 for IPv6 aware URL parsing, gnunet, 2019/12/20
- [gnurl] 03/151: ntlm: USE_WIN32_CRYPTO check removed to get USE_NTLM2SESSION set, gnunet, 2019/12/20
- [gnurl] 07/151: curlver: bump to 7.67.1, gnunet, 2019/12/20
- [gnurl] 01/151: configure: avoid unportable `==' test(1) operator, gnunet, 2019/12/20
- [gnurl] 22/151: quiche: reject headers in the wrong order, gnunet, 2019/12/20
- [gnurl] 13/151: TODO: Run web-platform-tests url tests, gnunet, 2019/12/20
- [gnurl] 16/151: strerror: Fix an error looking up some Windows error strings, gnunet, 2019/12/20
- [gnurl] 21/151: openssl: prevent recursive function calls from ctx callbacks, gnunet, 2019/12/20
- [gnurl] 18/151: test1558: use double slash after file:, gnunet, 2019/12/20
- [gnurl] 12/151: TODO: 1.4 alt-svc sharing, gnunet, 2019/12/20