Meta/GRADUATED: check different versions of maint

Junio C Hamano committed Sep 28, 2011 at 18:13 UTC 1c603a5fc8c922f62947f3235994720035e25fae
1 file changed +28 -2
GRADUATED
+28 -2
@@ -6,6 +6,20 @@ old_maint=$(
6 sed -e 's|^refs/heads/||'
7 )
8
9 +# Are older maint branches all included in newer ones?
10 +and_or_thru=thru prev=
11 +for m in $old_maint maint
12 +do
13 + if test -n "$prev"
14 + then
15 + test "$(git rev-list $m..$prev | wc -l)" = 0 || {
16 + and_or_thru=and
17 + break
18 + }
19 + fi
20 + prev=$m
21 +done
22 +
23 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
24 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
25 LF='
@@ -41,7 +55,7 @@ do
55 comm -23 "$tmp.both0" "$tmp.known" >"$tmp.both"
56 if test -s "$tmp.both"
57 then
44 - echo "# Graduated to both $m and master"
58 + echo "# Graduated to both $m $and_or_thru master"
59 while read branch
60 do
61 d=$(git describe $branch)
@@ -107,7 +121,19 @@ comm -13 "$tmp.maint" "$tmp.master" |
121 git log --pretty=oneline --abbrev-commit maint..$topic
122 } |
123 sed -e 's/^/: # /'
110 - echo "git checkout maint && git merge $topic"
124 + maint=maint
125 + these=$(git rev-list maint..$topic)
126 + for m in $old_maint maint
127 + do
128 + those=$(git rev-list $m..$topic)
129 + if test "z$these" = "z$those"
130 + then
131 + maint=$m
132 + break
133 + fi
134 + done
135 +
136 + echo "git checkout $maint && git merge $topic"
137 echo
138 done
139 fi