Meta/Reintegrate: omit cut mark if no topics were merged from the group

Junio C Hamano committed Jan 9, 2013 at 12:56 UTC 98b350d958a002b4124b17e4896b4ed048b8e9d0
1 file changed +12 -3
Reintegrate
+12 -3
@@ -84,12 +84,15 @@ no)
84 }
85
86 mark_cut () {
87 + test -n "$stop_at_cut" && return
88 +
89 + count_since_last_cut=$(( $count_since_last_cut + 1 ))
90 test -z "$prev_cut" && return
91 git commit --allow-empty -m "$prev_cut"
92 prev_cut=
93 }
94
92 - cut_seen=0 prev_cut=
95 + cut_seen=0 prev_cut= count_since_last_cut=0
96 while read branch eh
97 do
98 case "$branch" in '###') cut_seen=$(( $cut_seen + 1 )) ;; esac
@@ -100,8 +103,14 @@ no)
103
104 case "$branch" in
105 '###')
103 - echo >&2 "$branch $eh"
104 - prev_cut="$branch $eh"
106 + if test "$count_since_last_cut" = 0
107 + then
108 + prev_cut=
109 + else
110 + echo >&2 "$branch $eh"
111 + prev_cut="$branch $eh"
112 + count_since_last_cut=0
113 + fi
114 continue ;;
115 '#'* | '')
116 continue ;;