From f23272f3fd84fd37d97917f37233fbf01deb32b4 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 4 Dec 2007 23:01:30 -0800 Subject: [PATCH] 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 --- git-am.sh | 5 +++++ 1 file changed, 5 insertions(+) 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" ;; -- 2.30.2