]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
updated branchsync to deal with merge commits
authorEvan Hunt <each@isc.org>
Sat, 10 Mar 2018 21:29:32 +0000 (13:29 -0800)
committerEvan Hunt <each@isc.org>
Wed, 14 Mar 2018 21:42:24 +0000 (14:42 -0700)
(cherry picked from commit fccf8ca2f66df6e5d85c007c63cbb46f3c5dcfbb)

util/branchsync.sh

index e96a197ef32c46982ab05209c30fec3767c68f71..6fe50633b33a155159968ed0961249ae2e7d00d3 100644 (file)
@@ -124,10 +124,14 @@ if [ -z "$continuing" ]; then
 fi
 
 # loop through commits looking for ones that should be cherry-picked
-git log $SOURCEBRANCH --reverse --format='%H %aN' $LASTHASH..$SOURCEBRANCH | \
+git log $SOURCEBRANCH --first-parent --reverse --format='%H %aN' $LASTHASH..$SOURCEBRANCH | \
   awk '$0 !~ /Tinderbox/ {print $1}' | {
     while read hash; do
-        if git cherry-pick -xn ${hash}; then
+        mainline=
+        if [ `git cat-file -p ${hash} | grep '^parent [0-9a-f][0-9a-f]*$' | wc -l` -gt 1 ]; then
+            mainline="-m 1 "
+        fi
+        if git cherry-pick ${mainline} -xn ${hash}; then
             # cherry-pick was clean
             # restore the files that we don't want updated automatically
             restore_files