[ARVADOS-DEV] updated: ebf85170e71e15438a468f86e9aa3f5305d10341
Git user
git at public.arvados.org
Fri Jul 16 18:05:45 UTC 2021
Summary of changes:
git/hooks/check-copyright-headers.rb | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
via ebf85170e71e15438a468f86e9aa3f5305d10341 (commit)
from ebe111f73372695ac4c52529d4346840763e1811 (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 ebf85170e71e15438a468f86e9aa3f5305d10341
Author: Ward Vandewege <ward at curii.com>
Date: Fri Jul 16 14:05:22 2021 -0400
Update check-copyright-headers.rb so it can handle the first push to an
empty repository.
refs #17817
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 2f6b20d..7d726f9 100755
--- a/git/hooks/check-copyright-headers.rb
+++ b/git/hooks/check-copyright-headers.rb
@@ -58,9 +58,12 @@ def check_copyright_headers
all_objects = blob_objects + commit_objects
commits = `git rev-list main..#{$newrev}`.split("\n")
else
- # When does this happen?
- puts "UNEXPECTED ERROR"
- exit 1
+ # First push to an empty repository
+ puts "git rev-list --objects #{$newrev} | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)'| sed -n 's/^blob //p'"
+ blob_objects = `git rev-list --objects #{$newrev} | git cat-file --follow-symlinks --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)'| sed -n 's/^blob //p'`.split("\n")
+ commit_objects = `git rev-list --objects #{$newrev} | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)'| sed -n 's/^commit //p'`.split("\n")
+ all_objects = blob_objects + commit_objects
+ commits = `git rev-list #{$newrev}`.split("\n")
end
else
blob_objects = `git rev-list --objects #{$oldrev}..#{$newrev} --not --branches='*' | git cat-file --follow-symlinks --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)'| sed -n 's/^blob //p'`.split("\n")
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list