path: root/pretty.c
diff options
authorJunio C Hamano <>2009-11-21 07:53:55 (GMT)
committerJunio C Hamano <>2009-11-21 07:53:55 (GMT)
commit885d492f69a80ae3e91c1310a63caf0aeb567f2a (patch)
tree3240d00b6c56d2ea55daad2d18103e7b4d3cf89f /pretty.c
parent905bf7742cf5f4a6dea2e75ba2dbd89d5dfaa793 (diff)
parenta099469bbcf273e76d81573229971956b4ef0700 (diff)
Merge branch 'jh/notes' (early part)
* 'jh/notes' (early part): Add selftests verifying concatenation of multiple notes for the same commit Refactor notes code to concatenate multiple notes annotating the same object Add selftests verifying that we can parse notes trees with various fanouts Teach the notes lookup code to parse notes trees with various fanout schemes Teach notes code to free its internal data structures on request Add '%N'-format for pretty-printing commit notes Add flags to get_commit_notes() to control the format of the note string t3302-notes-index-expensive: Speed up create_repo() fast-import: Add support for importing commit notes Teach "-m <msg>" and "-F <file>" to "git notes edit" Add an expensive test for git-notes Speed up git notes lookup Add a script to edit/inspect notes Introduce commit notes Conflicts: .gitignore Documentation/pretty-formats.txt pretty.c
Diffstat (limited to 'pretty.c')
1 files changed, 10 insertions, 0 deletions
diff --git a/pretty.c b/pretty.c
index 2e031e6..5661cba 100644
--- a/pretty.c
+++ b/pretty.c
@@ -6,6 +6,7 @@
#include "string-list.h"
#include "mailmap.h"
#include "log-tree.h"
+#include "notes.h"
#include "color.h"
#include "reflog-walk.h"
@@ -773,6 +774,10 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder,
return 2;
return 0; /* unknown %g placeholder */
+ case 'N':
+ get_commit_notes(commit, sb, git_log_output_encoding ?
+ git_log_output_encoding : git_commit_encoding, 0);
+ return 1;
/* For the rest we have to parse the commit header. */
@@ -1050,5 +1055,10 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,
if (fmt == CMIT_FMT_EMAIL && sb->len <= beginning_of_body)
strbuf_addch(sb, '\n');
+ if (fmt != CMIT_FMT_ONELINE)
+ get_commit_notes(commit, sb, encoding,