[X2Go-Commits] [maintenancescripts] 08/08: git/hooks/x2go-post-receive-tag-pending: only execute on master and release branches.

git-admin at x2go.org git-admin at x2go.org
Tue Mar 3 14:25:54 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 43956eeee65c10877e1f0b6c2513a975fd673a1b
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Tue Mar 3 14:23:47 2020 +0100

    git/hooks/x2go-post-receive-tag-pending: only execute on master and release branches.
    
    This should mostly restore the original behavior, including correct
    operation in the case of merges, which was actually broken before.
---
 git/hooks/x2go-post-receive-tag-pending | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/git/hooks/x2go-post-receive-tag-pending b/git/hooks/x2go-post-receive-tag-pending
index cf6ac94..ba84e25 100755
--- a/git/hooks/x2go-post-receive-tag-pending
+++ b/git/hooks/x2go-post-receive-tag-pending
@@ -118,6 +118,20 @@ EOF
 }
 
 while read oldrev newrev refname; do
+  # Only process master or release branches.
+  # Others will not be processed, so any commits containing a Fixes/Closes statement as part
+  # of all the other branches will be silently ignored.
+  case "${refname}" in
+    ("refs/heads/master")
+      :
+      ;;
+    ("refs/heads/release/"*)
+      :
+      ;;
+    (*)
+      continue
+      ;;
+  esac
   typeset -a git_rev_list
   git_rev_list=( 'git' 'rev-list' '--reverse' '--stdin' )
   # For new branches/tags, do something special. Hopefully.
@@ -138,7 +152,11 @@ while read oldrev newrev refname; do
   # ignored as well, defeating the script's purpose. Hence, we'll manually filter out the negated tip
   # ref of the current branch (i.e., refname) we're interested in, keeping that one (and that one
   # only) in the loop.
-  git rev-parse --not --tags --branches | grep -v "$(git rev-parse ${refname})" | \
+  # However, since we want to ignore bug fix tags in changelog entries on all branches other than the
+  # master and release branches and only process them after they have been merged into master/release
+  # branches, we'll have to include only the latter. Merges from other branches will hence trigger
+  # emails the first time they are encountered.
+  git rev-parse --not --tags 'refs/heads/master' --branches='release/*' | grep -v "$(git rev-parse ${refname})" | \
   ${git_rev_list[@]} | \
   while read rev; do
     d="${tempdir}/${rev}.diff"

--
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