[ARVADOS-DEV] updated: 317350b0abd9608026c4f87d8ca53270ca19d37f
Git user
git at public.arvados.org
Tue Jun 16 21:25:48 UTC 2020
Summary of changes:
git/hooks/check-copyright-headers.rb | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
via 317350b0abd9608026c4f87d8ca53270ca19d37f (commit)
from 2f7e545114035b9c8750ff13c0e3e0d25cc5d618 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 317350b0abd9608026c4f87d8ca53270ca19d37f
Author: Ward Vandewege <ward at curii.com>
Date: Tue Jun 16 17:25:31 2020 -0400
Another bugfix for the check-copyright-headers.rb script.
No issue #
Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>
diff --git a/git/hooks/check-copyright-headers.rb b/git/hooks/check-copyright-headers.rb
index e5d86a1..2e32c59 100755
--- a/git/hooks/check-copyright-headers.rb
+++ b/git/hooks/check-copyright-headers.rb
@@ -83,8 +83,27 @@ def check_copyright_headers
filename = f
commit = `git show #{tmp[0]} -- #{f}`
if commit =~ /^new file mode \d{6}\nindex 000000/
- /^.*?@@\n(.*)$/m.match(commit)
- header = `echo "#{$1}" | head -n20 | egrep -A3 -B1 'Copyright.*All rights reserved.'`
+ headerCount = 0
+ lineCount = 0
+ header = ""
+ previousLine = ""
+ commit.each_line do |line|
+ if ((headerCount == 0) and (line =~ /Copyright.*All rights reserved./))
+ header = previousLine
+ header += line
+ headerCount = 1
+ elsif ((headerCount > 0) and (headerCount < 3))
+ header += line
+ headerCount += 1
+ elsif (headerCount == 3)
+ break
+ end
+ previousLine = line
+ lineCount += 1
+ if lineCount > 50
+ break
+ end
+ end
broken = check_file(filename, header, broken)
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list