pretty printing: extend %G? to include 'N' and 'U'
authorSebastian Götte <jaseg@physik.tu-berlin.de>
Sun, 31 Mar 2013 16:03:22 +0000 (18:03 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Apr 2013 05:38:53 +0000 (22:38 -0700)
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 <jaseg@physik-pool.tu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/pretty-formats.txt
pretty.c
index 293965524e81b240996a795498ba127f723d18eb..afac703f21245b6fa34af90b1da4b3194372a81d 100644 (file)
@@ -131,7 +131,8 @@ The placeholders are:
 - '%B': raw body (unwrapped subject and body)
 - '%N': commit notes
 - '%GG': raw verification message from GPG for a signed commit
-- '%G?': show either "G" for Good or "B" for Bad for a signed commit
+- '%G?': show "G" for a Good signature, "B" for a Bad signature, "U" for a good,
+  untrusted signature and "N" for no signature
 - '%GS': show the name of the signer for a signed commit
 - '%GK': show the key used to sign a signed commit
 - '%gD': reflog selector, e.g., `refs/stash@{1}`
index 35b592ad837b0e0394b6aa3036d6062043ae469f..d3a82d22d398ae7234f8917f4d8b0770ba4d0c47 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -1145,6 +1145,8 @@ static size_t format_commit_one(struct strbuf *sb, const char *placeholder,
                        switch (c->signature_check.result) {
                        case 'G':
                        case 'B':
+                       case 'U':
+                       case 'N':
                                strbuf_addch(sb, c->signature_check.result);
                        }
                        break;