]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Meta/Reintegrate: omit cut mark if no topics were merged from the group
authorJunio C Hamano <gitster@pobox.com>
Wed, 9 Jan 2013 20:56:39 +0000 (12:56 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Jan 2013 20:56:46 +0000 (12:56 -0800)
Reintegrate

index 1fad661b6ca6508530498c230ff203dec626aad1..da69ce5a0292b9027ea0c95a0a5cd149de257d1c 100755 (executable)
@@ -84,12 +84,15 @@ no)
        }
 
        mark_cut () {
+               test -n "$stop_at_cut" && return
+
+               count_since_last_cut=$(( $count_since_last_cut + 1 ))
                test -z "$prev_cut" && return
                git commit --allow-empty -m "$prev_cut"
                prev_cut=
        }
 
-       cut_seen=0 prev_cut=
+       cut_seen=0 prev_cut= count_since_last_cut=0
        while read branch eh
        do
                case "$branch" in '###') cut_seen=$(( $cut_seen + 1 )) ;; esac
@@ -100,8 +103,14 @@ no)
 
                case "$branch" in
                '###')
-                       echo >&2 "$branch $eh"
-                       prev_cut="$branch $eh"
+                       if test "$count_since_last_cut" = 0
+                       then
+                               prev_cut=
+                       else
+                               echo >&2 "$branch $eh"
+                               prev_cut="$branch $eh"
+                               count_since_last_cut=0
+                       fi
                        continue ;;
                '#'* | '')
                        continue ;;