Thread (9 messages) flat view 9 messages, 4 authors, 2016-06-15
STALE3750d

[PATCH] Initialize notes trees if %N is used and no --show-notes given

From: Johannes Gilger <hidden>
Date: 2016-06-15 22:48:33
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Johannes Gilger <redacted>
---
Hi list,

this bug bit me when I used 'git log --format="%N"' without adding
--show-notes, which caused git to fail an assertion:
 Assertion failed: (display_notes_trees), function format_display_notes, file notes.c, line 1186.

While this patch fixes this behaviour, I'm not sure it's at the right
place or doesn't impact performance. So this is meant more as a
bug-report.

Greetings,
Jojo

 notes.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/notes.c b/notes.c
index e425e19..83f39ae 100644
--- a/notes.c
+++ b/notes.c
@@ -1183,6 +1183,8 @@ void format_display_notes(const unsigned char *object_sha1,
 			  struct strbuf *sb, const char *output_encoding, int flags)
 {
 	int i;
+	if (!display_notes_trees)
+		init_display_notes(NULL);
 	assert(display_notes_trees);
 	for (i = 0; display_notes_trees[i]; i++)
 		format_note(display_notes_trees[i], object_sha1, sb,
-- 
1.7.0.4.360.g11766c
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help