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

Re: What's cooking in git.git (Apr 2010, #06; Sat, 17)

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 18, 2010, 18:20 UTC
Message-ID
<7vvdbowrkq.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20100418083641.GA17717@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> On Sat, Apr 17, 2010 at 11:16:00PM -0700, Junio C Hamano wrote:
>
>> * jg/auto-initialize-notes-with-percent-n-in-format (2010-04-13) 1 commit
>>  - pretty: Initialize notes if %N is used
>
> I think the last round looked good, and this would ideally go into
> v1.7.1, as it fixes a segfault. It is getting a bit late in the -rc
> cycle, though. I guess the other option is to close the segfault with a
> one-liner and just make %N a no-op for v1.7.1, and then fix it right for
> v1.7.2.  I think I would prefer to have Johannes' patch right away,
> though.

It is an assertion failure but the fix is low-impact enough to appear in the coming release.

 t/t3301-notes.sh |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index b2e7b07..64f32ad 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -55,6 +55,15 @@ test_expect_success 'handle empty notes gracefully' '
 	git notes show ; test 1 = $?
 '
 
+test_expect_success 'show non-existent notes entry with %N' '
+	for l in A B
+	do
+		echo "$l"
+	done >expect &&
+	git show -s --format='A%n%NB' >output &&
+	test_cmp expect output
+'
+
 test_expect_success 'create notes' '
 	git config core.notesRef refs/notes/commits &&
 	MSG=b4 git notes add &&
@@ -65,6 +74,15 @@ test_expect_success 'create notes' '
 	test_must_fail git notes show HEAD^
 '
 
+test_expect_success 'show notes entry with %N' '
+	for l in A b4 B
+	do
+		echo "$l"
+	done >expect &&
+	git show -s --format='A%n%NB' >output &&
+	test_cmp expect output
+'
+
 cat >expect <<EOF
 d423f8c refs/notes/commits@{0}: notes: Notes added by 'git notes add'
 EOF
Previous: Jeff KingNext: Jeff King
Message 3 of 4 in “What's cooking in git.git (Apr 2010, #06; Sat, 17)”
  1. Junio C HamanoApr 18, 2010
  2. Jeff KingApr 18, 2010
  3. Junio C HamanoApr 18, 2010
  4. Jeff KingApr 18, 2010

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.