[X2Go-Commits] [maintenancescripts] 05/05: git/hooks/x2go-post-receive-tag-pending: handle new branches/tags gracefully.

git-admin at x2go.org git-admin at x2go.org
Thu Jan 2 13:07:58 CET 2020


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository maintenancescripts.

commit b890e714fd03c1cbbba67365446590906e16b10f
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Jan 2 13:06:14 2020 +0100

    git/hooks/x2go-post-receive-tag-pending: handle new branches/tags gracefully.
    
    Hopefully, at least.
---
 git/hooks/x2go-post-receive-tag-pending | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/git/hooks/x2go-post-receive-tag-pending b/git/hooks/x2go-post-receive-tag-pending
index 80c4eaf..0e44ecf 100755
--- a/git/hooks/x2go-post-receive-tag-pending
+++ b/git/hooks/x2go-post-receive-tag-pending
@@ -118,8 +118,14 @@ EOF
 }
 
 while read oldrev newrev refname; do
+  git_rev_list="git rev-list --reverse --stdin '${oldrev}..${newrev}'"
+  # For new branches/tags, do something special. Hopefully.
+  typeset null_regex='^0{20,}$'
+  if [[ "${oldrev}" =~ ${null_regex} ]]; then
+    git_rev_list="git rev-list --reverse --stdin '${newrev}' --not --branches='*' --tags='*'"
+  fi
   git rev-parse --not --tags --not --branches='master' --branches='release/*' | grep -v "$(git rev-parse ${refname})" | \
-  git rev-list --reverse --stdin "${oldrev}..${newrev}" | \
+  ${git_rev_list} | \
   while read rev; do
     d="${tempdir}/${rev}.diff"
     git show "${rev}" -- "debian/changelog" >"${d}"

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/maintenancescripts.git


More information about the x2go-commits mailing list