From: Junio C Hamano Date: Wed, 5 Dec 2007 07:01:30 +0000 (-0800) Subject: git-am -i: report rewritten title X-Git-Tag: v1.5.4-rc0~37^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f23272f3fd84fd37d97917f37233fbf01deb32b4;p=git.git git-am -i: report rewritten title Jeff Garzik noticed that "git am -i" reports the applied patch with the title before the user edited it. This was confusing. Signed-off-by: Junio C Hamano --- diff --git a/git-am.sh b/git-am.sh index 5792631d8..44c558c94 100755 --- a/git-am.sh +++ b/git-am.sh @@ -102,6 +102,10 @@ It does not apply to blobs recorded in its index." unset GITHEAD_$his_tree } +reread_subject () { + git stripspace <"$1" | sed -e 1q +} + prec=4 dotest=.dotest sign= utf8=t keep= skip= interactive= resolved= binary= resolvemsg= resume= @@ -372,6 +376,7 @@ do [aA]*) action=yes interactive= ;; [nN]*) action=skip ;; [eE]*) git_editor "$dotest/final-commit" + SUBJECT=$(reread_subject "$dotest/final-commit") action=again ;; [vV]*) action=again LESS=-S ${PAGER:-less} "$dotest/patch" ;;