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 <gitster@pobox.com>
Junio C Hamano committed
Dec 4, 2007 at 23:01 UTC
f23272f3fd84fd37d97917f37233fbf01deb32b4
1 file changed
+5
git-am.sh
+5
@@ -102,6 +102,10 @@ It does not apply to blobs recorded in its index."
102
unset GITHEAD_$his_tree
103
}
104
105
+reread_subject () {
106
+ git stripspace <"$1" | sed -e 1q
107
+}
108
+
109
prec=4
110
dotest=.dotest sign= utf8=t keep= skip= interactive= resolved= binary=
111
resolvemsg= resume=
@@ -372,6 +376,7 @@ do
376
[aA]*) action=yes interactive= ;;
377
[nN]*) action=skip ;;
378
[eE]*) git_editor "$dotest/final-commit"
379
+ SUBJECT=$(reread_subject "$dotest/final-commit")
380
action=again ;;
381
[vV]*) action=again
382
LESS=-S ${PAGER:-less} "$dotest/patch" ;;