Skip to content

Commit 8b208f0

Browse files
dschogitster
authored andcommitted
Add '%N'-format for pretty-printing commit notes
Signed-off-by: Johan Herland <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c56fcc8 commit 8b208f0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Documentation/pretty-formats.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ The placeholders are:
123123
- '%s': subject
124124
- '%f': sanitized subject line, suitable for a filename
125125
- '%b': body
126+
- '%N': commit notes
126127
- '%Cred': switch color to red
127128
- '%Cgreen': switch color to green
128129
- '%Cblue': switch color to blue

pretty.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,10 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder,
702702
case 'd':
703703
format_decoration(sb, commit);
704704
return 1;
705+
case 'N':
706+
get_commit_notes(commit, sb, git_log_output_encoding ?
707+
git_log_output_encoding : git_commit_encoding, 0);
708+
return 1;
705709
}
706710

707711
/* For the rest we have to parse the commit header. */

0 commit comments

Comments
 (0)