]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Meta/Reintegrate: try keeping the cut points with comments
authorJunio C Hamano <gitster@pobox.com>
Wed, 9 Jan 2013 00:11:51 +0000 (16:11 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Jan 2013 00:13:55 +0000 (16:13 -0800)
Using empty commits on the throw-away trial integration branches,
keep track of the "doneness" comments in the history, so that
later run of "redo-*.sh -[ud]" can resurrect them.

Reintegrate

index 59cf994fc334c66326887b154736529f07d4df27..1fad661b6ca6508530498c230ff203dec626aad1 100755 (executable)
@@ -83,18 +83,25 @@ no)
                fi
        }
 
-       cut_seen=0
+       mark_cut () {
+               test -z "$prev_cut" && return
+               git commit --allow-empty -m "$prev_cut"
+               prev_cut=
+       }
+
+       cut_seen=0 prev_cut=
        while read branch eh
        do
                case "$branch" in '###') cut_seen=$(( $cut_seen + 1 )) ;; esac
                if test -n "$stop_at_cut" && test $stop_at_cut -le $cut_seen
                then
-                       continue
+                       continue ;# slurp the remainder and skip
                fi
 
                case "$branch" in
                '###')
-                       echo >&2 "$branch"
+                       echo >&2 "$branch $eh"
+                       prev_cut="$branch $eh"
                        continue ;;
                '#'* | '')
                        continue ;;
@@ -109,6 +116,8 @@ no)
                        mb=$(git merge-base "$tip" "$save")
                        test "$mb" = "$tip" && continue
 
+                       mark_cut
+
                        EDITOR=: git merge $accept_rerere --edit "$branch" ||
                        accept_rerere ||
                        exit
@@ -130,6 +139,9 @@ no)
                        ;;
                pick" "*)
                        echo >&2 "* $eh"
+
+                       mark_cut
+
                        git cherry-pick "$branch" || exit ;;
                *) echo >&2 "Eh? $branch $eh"; exit ;;
                esac
@@ -175,7 +187,15 @@ show_merge () {
 }
 
 show_pick () {
-       merged="$(git rev-parse --verify "$commit") pick $msg" 
+       case "$msg" in
+       "### "* | "###")
+               merged="$msg"
+               ;;
+       *)
+               merged="$(git rev-parse --verify "$commit") pick $msg"
+               ;;
+       esac
+
 }
 
 generate () {