From 1c603a5fc8c922f62947f3235994720035e25fae Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 28 Sep 2011 18:13:45 -0700 Subject: [PATCH] Meta/GRADUATED: check different versions of maint --- GRADUATED | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/GRADUATED b/GRADUATED index 12f1793394..45bf8b2102 100755 --- a/GRADUATED +++ b/GRADUATED @@ -6,6 +6,20 @@ old_maint=$( sed -e 's|^refs/heads/||' ) +# Are older maint branches all included in newer ones? +and_or_thru=thru prev= +for m in $old_maint maint +do + if test -n "$prev" + then + test "$(git rev-list $m..$prev | wc -l)" = 0 || { + and_or_thru=and + break + } + fi + prev=$m +done + _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" LF=' @@ -41,7 +55,7 @@ do comm -23 "$tmp.both0" "$tmp.known" >"$tmp.both" if test -s "$tmp.both" then - echo "# Graduated to both $m and master" + echo "# Graduated to both $m $and_or_thru master" while read branch do d=$(git describe $branch) @@ -107,7 +121,19 @@ comm -13 "$tmp.maint" "$tmp.master" | git log --pretty=oneline --abbrev-commit maint..$topic } | sed -e 's/^/: # /' - echo "git checkout maint && git merge $topic" + maint=maint + these=$(git rev-list maint..$topic) + for m in $old_maint maint + do + those=$(git rev-list $m..$topic) + if test "z$these" = "z$those" + then + maint=$m + break + fi + done + + echo "git checkout $maint && git merge $topic" echo done fi -- 2.47.3