Code

Add '%N'-format for pretty-printing commit notes
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Fri, 9 Oct 2009 10:22:05 +0000 (12:22 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Oct 2009 02:00:24 +0000 (19:00 -0700)
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/pretty-formats.txt
pretty.c

index 2a845b1e57590a6f18f05fd3efa858b736c1071a..5fb10b3a1525dabd0f0e75835847a6187fa99a30 100644 (file)
@@ -123,6 +123,7 @@ The placeholders are:
 - '%s': subject
 - '%f': sanitized subject line, suitable for a filename
 - '%b': body
+- '%N': commit notes
 - '%Cred': switch color to red
 - '%Cgreen': switch color to green
 - '%Cblue': switch color to blue
index 01eadd0482f234e2e89ce1e78dbcb1b3a303278e..7f350bbdff050041f541d227de6bfe20ec7fe510 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -702,6 +702,10 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder,
        case 'd':
                format_decoration(sb, commit);
                return 1;
+       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. */