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

Subsystems: the rest

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:40

Jeff King [off-list ref] writes:
On Sat, Apr 17, 2010 at 11:16:00PM -0700, Junio C Hamano wrote:
quoted
* 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

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

From: Jeff King <hidden>
Date: 2016-06-15 22:48:40

On Sun, Apr 18, 2010 at 11:20:21AM -0700, Junio C Hamano wrote:
quoted
quoted
* jg/auto-initialize-notes-with-percent-n-in-format (2010-04-13) 1 commit
 - pretty: Initialize notes if %N is used
[...]

It is an assertion failure but the fix is low-impact enough to appear in
the coming release.
Yeah, I forgot it was an assertion and not a segfault, but I think both
are things we would rather not see in a release.
 t/t3301-notes.sh |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
Your tests look sane to me.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help