From: Junio C Hamano Date: Fri, 16 Mar 2012 20:04:28 +0000 (-0700) Subject: Meta/Reintegrate: allow each step to be optionally amended X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=370023272cdce6020e439e70879d90455d4cc75e;p=thirdparty%2Fgit.git Meta/Reintegrate: allow each step to be optionally amended This will let me run 'Meta/Reintegrate -e' and feed the selected branches while on 'master', i.e. the final graduation ceremony, and clean up the merge messages. --- diff --git a/Reintegrate b/Reintegrate index f56214fc43..997c4cd10e 100755 --- a/Reintegrate +++ b/Reintegrate @@ -1,10 +1,11 @@ #!/bin/sh -accept_rerere="--rerere-autoupdate" generate=no update= diff= +accept_rerere="--rerere-autoupdate" generate=no update= diff= edit= while case "$#,$1" in 0,*) break;; *,-*) ;; esac do case "$1" in -n) accept_rerere= ;; + -e) edit=t ;; -d) update=${2?"diff with what?"} diff=yes generate=yes @@ -66,7 +67,7 @@ annotate_merge () { case "$generate" in no) accept_rerere () { - if ! git write-tree 2>/dev/null + if ! git write-tree 2>/dev/null >/dev/null then git rerere remaining return 1 @@ -94,6 +95,8 @@ no) exit annotate_merge "$branch" || exit + test -z "$edit" || + git commit --amend || exit this=$(git rev-parse --verify HEAD) if test "$this" = "$save"