git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Cosmetic git-am interactive bug

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 5, 2007, 07:01 UTC
Message-ID
<7v8x491v79.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<4755A836.1050408@garzik.org>
Jeff Garzik <jeff@garzik.org> writes:
> The use of the older one-line summary led me to believe that it had
> not committed my changelog edits.  Looking at the result, however,
> proved that the commit changelog was my new, corrected version.

I knew about this for quite some time but it was a very low priority for me. This should fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
diff --git a/git-am.sh b/git-am.sh
index 2e40708..339d863 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -117,6 +117,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=
@@ -376,6 +380,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" ;;
Previous: Jeff GarzikNext: Jeff Garzik
Message 2 of 3 in “Cosmetic git-am interactive bug”
  1. Jeff GarzikDec 4, 2007
  2. Junio C HamanoDec 5, 2007
  3. Jeff GarzikDec 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.