git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v4 5/5] pretty printing: extend %G? to include 'N' and 'U'

From
SGSebastian Götte <jaseg@physik.tu-berlin.de>
Date
Mar 26, 2013, 11:05 UTC
Message-ID
<51518114.9050902@physik.tu-berlin.de>
In-Reply-To
<cover.1364295502.git.jaseg@physik-pool.tu-berlin.de>

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>
---
 Documentation/pretty-formats.txt | 3 ++-
 pretty.c                         | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index 2939655..afac703 100644
--- a/Documentation/pretty-formats.txt
+++ b/Documentation/pretty-formats.txt
@@ -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}`
diff --git a/pretty.c b/pretty.c
index 3aac5d8..fc74795 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1135,6 +1135,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;
-- 
1.8.1.5
Previous: Sebastian GötteNext: Sebastian Götte
Message 20 of 62 in “Move commit GPG signature verification to commit.c”
  1. 1/4 Move commit GPG signature verification to commit.cSebastian Götte, Mar 23, 2013
  2. Junio C HamanoMar 25, 2013
  3. 0/5 Verify GPG signatures when merging and extend %G? pretty stringSebastian Götte, Mar 25, 2013
  4. Junio C HamanoMar 26, 2013
  5. 0/5 Verify GPG signatures when merging and extend %G? pretty stringSebastian Götte, Mar 26, 2013
  6. Junio C HamanoMar 26, 2013
  7. Sebastian GötteMar 26, 2013
  8. 1/5 Move commit GPG signature verification to commit.cSebastian Götte, Mar 25, 2013
  9. 2/5 commit.c/GPG signature verification: Also look at the first GPG status lineSebastian Götte, Mar 25, 2013
  10. 3/5 merge/pull: verify GPG signatures of commits being mergedSebastian Götte, Mar 25, 2013
  11. 4/5 merge/pull Check for untrusted good GPG signaturesSebastian Götte, Mar 25, 2013
  12. 5/5 pretty printing: extend %G? to include 'N' and 'U'Sebastian Götte, Mar 25, 2013
  13. 1/5 Move commit GPG signature verification to commit.cSebastian Götte, Mar 26, 2013
  14. 2/5 commit.c/GPG signature verification: Also look at the first GPG status lineSebastian Götte, Mar 26, 2013
  15. Junio C HamanoMar 28, 2013
  16. 3/5 merge/pull: verify GPG signatures of commits being mergedSebastian Götte, Mar 26, 2013
  17. Junio C HamanoMar 28, 2013
  18. 0/5 Verify GPG signatures when merging and extend %G? pretty stringSebastian Götte, Mar 30, 2013
  19. 4/5 merge/pull Check for untrusted good GPG signaturesSebastian Götte, Mar 26, 2013
  20. 5/5 pretty printing: extend %G? to include 'N' and 'U'Sebastian Götte, Mar 26, 2013
  21. 1/5 Move commit GPG signature verification to commit.cSebastian Götte, Mar 30, 2013
  22. Junio C HamanoMar 30, 2013
  23. 2/5 commit.c/GPG signature verification: Also look at the first GPG status lineSebastian Götte, Mar 30, 2013
  24. Junio C HamanoMar 30, 2013
  25. 3/5 merge/pull: verify GPG signatures of commits being mergedSebastian Götte, Mar 30, 2013
  26. Junio C HamanoMar 30, 2013
  27. 0/5 Verify GPG signatures when merging and extend %G? pretty stringSebastian Götte, Mar 30, 2013
  28. 4/5 merge/pull Check for untrusted good GPG signaturesSebastian Götte, Mar 30, 2013
  29. Thomas RastMar 31, 2013
  30. Sebastian GötteMar 31, 2013
  31. Thomas RastMar 31, 2013
  32. Sebastian GötteMar 31, 2013
  33. Thomas RastMar 31, 2013
  34. Sebastian GötteMar 31, 2013
  35. John KeepingMar 31, 2013
  36. 0/5 Verify GPG signatures when merging and extend %G? pretty stringSebastian Götte, Mar 31, 2013
  37. 5/5 pretty printing: extend %G? to include 'N' and 'U'Sebastian Götte, Mar 30, 2013
  38. 1/5 Move commit GPG signature verification to commit.cSebastian Götte, Mar 30, 2013
  39. 2/5 commit.c/GPG signature verification: Also look at the first GPG status lineSebastian Götte, Mar 30, 2013
  40. 3/5 merge/pull: verify GPG signatures of commits being mergedSebastian Götte, Mar 30, 2013
  41. 4/5 merge/pull Check for untrusted good GPG signaturesSebastian Götte, Mar 30, 2013
  42. 5/5 pretty printing: extend %G? to include 'N' and 'U'Sebastian Götte, Mar 30, 2013
  43. 1/5 Move commit GPG signature verification to commit.cSebastian Götte, Mar 31, 2013
  44. 2/5 commit.c/GPG signature verification: Also look at the first GPG status lineSebastian Götte, Mar 31, 2013
  45. John KeepingMar 31, 2013
  46. 3/5 merge/pull: verify GPG signatures of commits being mergedSebastian Götte, Mar 31, 2013
  47. 4/5 merge/pull Check for untrusted good GPG signaturesSebastian Götte, Mar 31, 2013
  48. John KeepingMar 31, 2013
  49. Thomas RastMar 31, 2013
  50. Sebastian GötteMar 31, 2013
  51. Thomas RastMar 31, 2013
  52. John KeepingMar 31, 2013
  53. 0/5 Verify GPG signatures when merging and extend %G? pretty stringSebastian Götte, Mar 31, 2013
  54. 5/5 pretty printing: extend %G? to include 'N' and 'U'Sebastian Götte, Mar 31, 2013
  55. 1/5 Move commit GPG signature verification to commit.cSebastian Götte, Mar 31, 2013
  56. 2/5 commit.c/GPG signature verification: Also look at the first GPG status lineSebastian Götte, Mar 31, 2013
  57. 3/5 merge/pull: verify GPG signatures of commits being mergedSebastian Götte, Mar 31, 2013
  58. Junio C HamanoApr 1, 2013
  59. Sebastian GötteApr 1, 2013
  60. Junio C HamanoApr 1, 2013
  61. 4/5 merge/pull Check for untrusted good GPG signaturesSebastian Götte, Mar 31, 2013
  62. 5/5 pretty printing: extend %G? to include 'N' and 'U'Sebastian Götte, Mar 31, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.