Skip to content

Commit e290c4b

Browse files
Sebastian Göttegitster
authored andcommitted
pretty printing: extend %G? to include 'N' and 'U'
Expand %G? in pretty format strings to 'N' in case of no GPG signature and 'U' in case of a good but untrusted GPG signature in addition to the previous 'G'ood and 'B'ad. This eases writing anyting parsing git-log output. Signed-off-by: Sebastian Götte <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eb307ae commit e290c4b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Documentation/pretty-formats.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ The placeholders are:
131131
- '%B': raw body (unwrapped subject and body)
132132
- '%N': commit notes
133133
- '%GG': raw verification message from GPG for a signed commit
134-
- '%G?': show either "G" for Good or "B" for Bad for a signed commit
134+
- '%G?': show "G" for a Good signature, "B" for a Bad signature, "U" for a good,
135+
untrusted signature and "N" for no signature
135136
- '%GS': show the name of the signer for a signed commit
136137
- '%GK': show the key used to sign a signed commit
137138
- '%gD': reflog selector, e.g., `refs/stash@{1}`

pretty.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,8 @@ static size_t format_commit_one(struct strbuf *sb, const char *placeholder,
11451145
switch (c->signature_check.result) {
11461146
case 'G':
11471147
case 'B':
1148+
case 'U':
1149+
case 'N':
11481150
strbuf_addch(sb, c->signature_check.result);
11491151
}
11501152
break;

0 commit comments

Comments
 (0)