{"thread":{"id":"33263","subject":"[PATCH v2 4/4] pretty printing: extend %G? to include 'N' and 'U'","startedAt":"2013-03-23T01:57:50Z","lastAt":"2013-03-23T01:57:50Z","messageCount":1,"participants":["Sebastian Götte"],"isPatch":true,"patchVersion":2,"patchTotal":4},"messages":[{"id":"212009","messageId":"514D0C1E.9080908@physik.tu-berlin.de","threadId":"33263","inReplyTo":null,"subject":"[PATCH v2 4/4] pretty printing: extend %G? to include 'N' and 'U'","fromName":"Sebastian Götte","fromEmail":"jaseg@physik.tu-berlin.de","sentAt":"2013-03-23T01:57:50Z","receivedAt":"2013-03-23T01:57:50Z","isPatch":true,"sender":{"key":"jaseg@physik.tu-berlin.de","avatar":null},"body":"Expand %G? in pretty format strings to 'N' in case of no GPG signature\nand 'U' in case of a good but untrusted GPG signature in addition to\nthe previous 'G'ood and 'B'ad. This eases writing anyting parsing\ngit-log output.\n\nSigned-off-by: Sebastian Götte <jaseg@physik-pool.tu-berlin.de>\n---\n Documentation/pretty-formats.txt | 3 ++-\n pretty.c                         | 2 ++\n 2 files changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\nindex 105f18a..69bd77a 100644\n--- a/Documentation/pretty-formats.txt\n+++ b/Documentation/pretty-formats.txt\n@@ -131,7 +131,8 @@ The placeholders are:\n - '%B': raw body (unwrapped subject and body)\n - '%N': commit notes\n - '%GG': raw verification message from GPG for a signed commit\n-- '%G?': show either \"G\" for Good or \"B\" for Bad for a signed commit\n+- '%G?': show \"G\" for a Good signature, \"B\" for a Bad signature, \"U\" for a good,\n+  untrusted signature and \"N\" for no signature\n - '%GS': show the name of the signer for a signed commit\n - '%gD': reflog selector, e.g., `refs/stash@{1}`\n - '%gd': shortened reflog selector, e.g., `stash@{1}`\ndiff --git a/pretty.c b/pretty.c\nindex 0547df1..875a1db 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -1136,6 +1136,8 @@ static size_t format_commit_one(struct strbuf *sb, const char *placeholder,\n \t\t\tswitch (c->signature.check_result) {\n \t\t\tcase 'G':\n \t\t\tcase 'B':\n+\t\t\tcase 'U':\n+\t\t\tcase 'N':\n \t\t\t\tstrbuf_addch(sb, c->signature.check_result);\n \t\t\t}\n \t\t\tbreak;\n-- \n1.8.1.5\n"}]}