{"thread":{"id":"44150","subject":"Request: Extra case for %G? format","startedAt":"2016-09-25T06:06:18Z","lastAt":"2016-10-12T13:04:56Z","messageCount":16,"participants":["Alex","Michael J Gruber","Junio C Hamano","Ramsay Jones"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"302503","messageId":"87d1js1pl1.fsf@gmail.com","threadId":"44150","inReplyTo":null,"subject":"Request: Extra case for %G? format","fromName":"Alex","fromEmail":"agrambot@gmail.com","sentAt":"2016-09-25T06:05:46Z","receivedAt":"2016-09-25T06:06:18Z","isPatch":false,"sender":{"key":"agrambot@gmail.com","avatar":null},"body":"Hello all,\n\nCould the %G? format differentiate between an unsigned commit and a\nsigned commit that you're missing a public key for?\n\nIf `git show --format=%GG --no-patch <commit>' produces an output like\nthe following:\n\ngpg: Signature made <date> using RSA key ID <id>\ngpg: Can't check signature: public key not found\n\nThen currently %G? results in `N', the same as an unsigned commit.\n\nIn this case, could %G? please result in a new character? Perhaps `M'\nfor \"missing public key\"?\n"},{"id":"302559","messageId":"f056af47-ca98-b35c-e343-9f246c0c8f5b@drmicha.warpmail.net","threadId":"44150","inReplyTo":"87d1js1pl1.fsf@gmail.com","subject":"Re: Request: Extra case for %G? format","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2016-09-26T11:53:57Z","receivedAt":"2016-09-26T11:54:06Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Alex venit, vidit, dixit 25.09.2016 08:05:\n> Hello all,\n> \n> Could the %G? format differentiate between an unsigned commit and a\n> signed commit that you're missing a public key for?\n> \n> If `git show --format=%GG --no-patch <commit>' produces an output like\n> the following:\n> \n> gpg: Signature made <date> using RSA key ID <id>\n> gpg: Can't check signature: public key not found\n\nThat is the \"raw verification message from GPG for a signed commit\" as\nper git-log(1).\n\n> Then currently %G? results in `N', the same as an unsigned commit.\n> \n> In this case, could %G? please result in a new character? Perhaps `M'\n> for \"missing public key\"?\n\nYes, and no.\n\nReally, there are many different reasons why a signature couldn't be\nchecked, but gpg itself has these status results:\n\n\"For each signature only one of the three codes GOODSIG, BADSIG or\nERRSIG will be emitted\" (doc/DETAILS in gpg's source).\n\nERRSIG comes with additional info (RC) that could be parsed for the reason.\n\nAlso, in addition to that line, there can be other lines with additional\ninformation. So there is a lot that could potentially be shown (and *is*\nshown with %GG). In the GOODSIG case, we parse the TRUST info to take\nthe trust model into account (and return U for untrusted good).\n\nI wouldn't mind adding E to %G? in the ERRSIG case, even though one has\nto look at %GG in any case (N or E) if one wants to have more details.\n\nCheers,\nMichael\n\n"},{"id":"302588","messageId":"87y42ey3z4.fsf@gmail.com","threadId":"44150","inReplyTo":"f056af47-ca98-b35c-e343-9f246c0c8f5b@drmicha.warpmail.net","subject":"Re: Request: Extra case for %G? format","fromName":"Alex","fromEmail":"agrambot@gmail.com","sentAt":"2016-09-26T17:18:23Z","receivedAt":"2016-09-26T17:18:49Z","isPatch":false,"sender":{"key":"agrambot@gmail.com","avatar":null},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n>> Then currently %G? results in `N', the same as an unsigned commit.\n>> \n>> In this case, could %G? please result in a new character? Perhaps `M'\n>> for \"missing public key\"?\n>\n> Yes, and no.\n>\n> Really, there are many different reasons why a signature couldn't be\n> checked, but gpg itself has these status results:\n>\n> \"For each signature only one of the three codes GOODSIG, BADSIG or\n> ERRSIG will be emitted\" (doc/DETAILS in gpg's source).\n\nI see. It seems in GPG2 that got expanded to:\n\n\"For each signature only one of the codes GOODSIG, BADSIG, EXPSIG,\nEXPKEYSIG, REVKEYSIG or ERRSIG will be emitted.\"\n\nI don't suppose it's worthwhile to support the others? I'm not sure how\nimportant the rest are.\n\n> ERRSIG comes with additional info (RC) that could be parsed for the reason.\n>\n> Also, in addition to that line, there can be other lines with additional\n> information. So there is a lot that could potentially be shown (and *is*\n> shown with %GG). In the GOODSIG case, we parse the TRUST info to take\n> the trust model into account (and return U for untrusted good).\n>\n> I wouldn't mind adding E to %G? in the ERRSIG case, even though one has\n> to look at %GG in any case (N or E) if one wants to have more details.\n\nThat would be great. As long as %G? can tell between a signed but\nuncheckable commit and an unsigned commit, then it's good for me.\n\n>\n> Cheers,\n> Michael\n\nThanks,\nAlex\n"},{"id":"302702","messageId":"06b5e0bfb898c7b3c6a866df5bda0ab4587284c6.1474986563.git.git@drmicha.warpmail.net","threadId":"44150","inReplyTo":"87y42ey3z4.fsf@gmail.com","subject":"[PATCH] gpg-interface: use more status letters","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2016-09-27T14:31:40Z","receivedAt":"2016-09-27T14:31:50Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"According to gpg2's doc/DETAILS:\n\"For each signature only one of the codes GOODSIG, BADSIG, EXPSIG,\nEXPKEYSIG, REVKEYSIG or ERRSIG will be emitted.\"\n\ngpg1 (\"classic\") behaves the same (although doc/DETAILS\ndiffers).\n\nCurrently, we parse gpg's status output for GOODSIG, BADSIG and trust\ninformation and translate that into status codes G, B, U, N for the %G?\nformat specifier.\n\ngit-verify-* returns success in the GOODSIG case only. This is somewhat in\ndisagreement with gpg, which considers the first 5 of the 6 above as VALIDSIG,\nbut we err on the very safe side.\n\nIntroduce additional status codes E, X, R for ERRSIG, EXP*SIG, REVKEYSIG\nso that a user of %G? gets more information about the absence of a 'G'\non first glance.\n\nReported-by: Alex <agrambot@gmail.com>\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nI'd be happy to learn are more portable/safer/cooler way to make gpg forget\nthat key in the added test...\n\n Documentation/pretty-formats.txt |  9 +++++++--\n gpg-interface.c                  |  4 ++++\n pretty.c                         |  3 +++\n t/t7510-signed-commit.sh         | 11 ++++++++++-\n 4 files changed, 24 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\nindex a942d57..806b47f 100644\n--- a/Documentation/pretty-formats.txt\n+++ b/Documentation/pretty-formats.txt\n@@ -143,8 +143,13 @@ ifndef::git-rev-list[]\n - '%N': commit notes\n endif::git-rev-list[]\n - '%GG': raw verification message from GPG for a signed commit\n-- '%G?': show \"G\" for a good (valid) signature, \"B\" for a bad signature,\n-  \"U\" for a good signature with unknown validity and \"N\" for no signature\n+- '%G?': show \"G\" for a good (rather: valid) signature,\n+  \"B\" for a bad signature,\n+  \"U\" for a good signature with unknown validity,\n+  \"X\" for a good expired signature, or good signature made by an expired key,\n+  \"R\" for a good signature made by a revoked key,\n+  \"E\" if the signature cannot be checked (e.g. missing key)\n+  and \"N\" for no signature\n - '%GS': show the name of the signer for a signed commit\n - '%GK': show the key used to sign a signed commit\n - '%gD': reflog selector, e.g., `refs/stash@{1}` or\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 8672eda..8a3e245 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -33,6 +33,10 @@ static struct {\n \t{ 'B', \"\\n[GNUPG:] BADSIG \" },\n \t{ 'U', \"\\n[GNUPG:] TRUST_NEVER\" },\n \t{ 'U', \"\\n[GNUPG:] TRUST_UNDEFINED\" },\n+\t{ 'E', \"\\n[GNUPG:] ERRSIG \"},\n+\t{ 'X', \"\\n[GNUPG:] EXPSIG \"},\n+\t{ 'X', \"\\n[GNUPG:] EXPKEYSIG \"},\n+\t{ 'R', \"\\n[GNUPG:] REVKEYSIG \"},\n };\n \n void parse_gpg_output(struct signature_check *sigc)\ndiff --git a/pretty.c b/pretty.c\nindex 493edb0..39a36cd 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -1232,8 +1232,11 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */\n \t\t\tswitch (c->signature_check.result) {\n \t\t\tcase 'G':\n \t\t\tcase 'B':\n+\t\t\tcase 'E':\n \t\t\tcase 'U':\n \t\t\tcase 'N':\n+\t\t\tcase 'X':\n+\t\t\tcase 'R':\n \t\t\t\tstrbuf_addch(sb, c->signature_check.result);\n \t\t\t}\n \t\t\tbreak;\ndiff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh\nindex 6e839f5..fd22742 100755\n--- a/t/t7510-signed-commit.sh\n+++ b/t/t7510-signed-commit.sh\n@@ -190,7 +190,7 @@ test_expect_success GPG 'show bad signature with custom format' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG 'show unknown signature with custom format' '\n+test_expect_success GPG 'show untrusted signature with custom format' '\n \tcat >expect <<-\\EOF &&\n \tU\n \t61092E85B7227189\n@@ -200,6 +200,15 @@ test_expect_success GPG 'show unknown signature with custom format' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success GPG 'show unknown signature with custom format' '\n+\tcat >expect <<-\\EOF &&\n+\tE\n+\t61092E85B7227189\n+\tEOF\n+\tGNUPGHOME=/dev/null git log -1 --format=\"%G?%n%GK\" eighth-signed-alt >actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success GPG 'show lack of signature with custom format' '\n \tcat >expect <<-\\EOF &&\n \tN\n-- \n2.10.0.527.gbcb6904\n\n"},{"id":"302723","messageId":"xmqqk2dxp84i.fsf@gitster.mtv.corp.google.com","threadId":"44150","inReplyTo":"06b5e0bfb898c7b3c6a866df5bda0ab4587284c6.1474986563.git.git@drmicha.warpmail.net","subject":"Re: [PATCH] gpg-interface: use more status letters","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-27T17:25:49Z","receivedAt":"2016-09-27T17:25:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> According to gpg2's doc/DETAILS:\n> \"For each signature only one of the codes GOODSIG, BADSIG, EXPSIG,\n> EXPKEYSIG, REVKEYSIG or ERRSIG will be emitted.\"\n>\n> gpg1 (\"classic\") behaves the same (although doc/DETAILS\n> differs).\n>\n> Currently, we parse gpg's status output for GOODSIG, BADSIG and trust\n> information and translate that into status codes G, B, U, N for the %G?\n> format specifier.\n>\n> git-verify-* returns success in the GOODSIG case only. This is somewhat in\n> disagreement with gpg, which considers the first 5 of the 6 above as VALIDSIG,\n> but we err on the very safe side.\n>\n> Introduce additional status codes E, X, R for ERRSIG, EXP*SIG, REVKEYSIG\n> so that a user of %G? gets more information about the absence of a 'G'\n> on first glance.\n>\n> Reported-by: Alex <agrambot@gmail.com>\n> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n\nThat probably was requested-by, but that's OK.\n\n> I'd be happy to learn are more portable/safer/cooler way to make gpg forget\n> that key in the added test...\n\nWe seem to set GNUPGHOME to $HOME/gnupg-home-not-used in test-lib.sh\nto say \"No gnupg keys for you!\" for all the tests by default, which\nis overriden by the signature tests like 7510.  I do not know if\nthat is more portable/safer/cooler than setting it to /dev/null but\nimitating it might be a way for you to push the potential problem\naway to other people ;-)  If it becomes an issue to set it to a\ndirectory that does not exist with an updated future version of GPG,\nthis new test will share the same problem with everybody else, and\nhopefully the solution would be the same ;-)\n\nHaving said that, if GNUPGHOME=/dev/null works for you, that's good\nenough for now, so that people on other platforms can test it and\nreport.\n\nThanks.\n\n> diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh\n> index 6e839f5..fd22742 100755\n> --- a/t/t7510-signed-commit.sh\n> +++ b/t/t7510-signed-commit.sh\n> @@ -190,7 +190,7 @@ test_expect_success GPG 'show bad signature with custom format' '\n>  \ttest_cmp expect actual\n>  '\n>  \n> -test_expect_success GPG 'show unknown signature with custom format' '\n> +test_expect_success GPG 'show untrusted signature with custom format' '\n>  \tcat >expect <<-\\EOF &&\n>  \tU\n>  \t61092E85B7227189\n> @@ -200,6 +200,15 @@ test_expect_success GPG 'show unknown signature with custom format' '\n>  \ttest_cmp expect actual\n>  '\n>  \n> +test_expect_success GPG 'show unknown signature with custom format' '\n> +\tcat >expect <<-\\EOF &&\n> +\tE\n> +\t61092E85B7227189\n> +\tEOF\n> +\tGNUPGHOME=/dev/null git log -1 --format=\"%G?%n%GK\" eighth-signed-alt >actual &&\n> +\ttest_cmp expect actual\n> +'\n> +\n>  test_expect_success GPG 'show lack of signature with custom format' '\n>  \tcat >expect <<-\\EOF &&\n>  \tN\n"},{"id":"302808","messageId":"c4777ef68059034d7ad4697a06bba3cabbdc9265.1475053649.git.git@drmicha.warpmail.net","threadId":"44150","inReplyTo":"xmqqk2dxp84i.fsf@gitster.mtv.corp.google.com","subject":"[PATCH v2] gpg-interface: use more status letters","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2016-09-28T14:24:13Z","receivedAt":"2016-09-28T14:24:22Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"According to gpg2's doc/DETAILS:\n\"For each signature only one of the codes GOODSIG, BADSIG, EXPSIG,\nEXPKEYSIG, REVKEYSIG or ERRSIG will be emitted.\"\n\ngpg1 (\"classic\") behaves the same (although doc/DETAILS\ndiffers).\n\nCurrently, we parse gpg's status output for GOODSIG, BADSIG and trust\ninformation and translate that into status codes G, B, U, N for the %G?\nformat specifier.\n\ngit-verify-* returns success in the GOODSIG case only. This is somewhat in\ndisagreement with gpg, which considers the first 5 of the 6 above as VALIDSIG,\nbut we err on the very safe side.\n\nIntroduce additional status codes E, X, R for ERRSIG, EXP*SIG, REVKEYSIG\nso that a user of %G? gets more information about the absence of a 'G'\non first glance.\n\nRequested-by: Alex <agrambot@gmail.com>\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nChanges in v2:\n\n- Use GNUPGHOME=\"$HOME/gnupg-home-not-used\" just like in other tests (lib).\n- Do not parse for signer UID in the ERRSIG case (and test that we do not).\n- Retreat \"rather\" addition from the doc: good/valid are terms that we use\n  differently from gpg anyways.\n\n Documentation/pretty-formats.txt |  9 +++++++--\n gpg-interface.c                  | 13 ++++++++++---\n pretty.c                         |  3 +++\n t/t7510-signed-commit.sh         | 12 +++++++++++-\n 4 files changed, 31 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\nindex a942d57..c28ff2b 100644\n--- a/Documentation/pretty-formats.txt\n+++ b/Documentation/pretty-formats.txt\n@@ -143,8 +143,13 @@ ifndef::git-rev-list[]\n - '%N': commit notes\n endif::git-rev-list[]\n - '%GG': raw verification message from GPG for a signed commit\n-- '%G?': show \"G\" for a good (valid) signature, \"B\" for a bad signature,\n-  \"U\" for a good signature with unknown validity and \"N\" for no signature\n+- '%G?': show \"G\" for a good (valid) signature,\n+  \"B\" for a bad signature,\n+  \"U\" for a good signature with unknown validity,\n+  \"X\" for a good expired signature, or good signature made by an expired key,\n+  \"R\" for a good signature made by a revoked key,\n+  \"E\" if the signature cannot be checked (e.g. missing key)\n+  and \"N\" for no signature\n - '%GS': show the name of the signer for a signed commit\n - '%GK': show the key used to sign a signed commit\n - '%gD': reflog selector, e.g., `refs/stash@{1}` or\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 8672eda..6999e7b 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -33,6 +33,10 @@ static struct {\n \t{ 'B', \"\\n[GNUPG:] BADSIG \" },\n \t{ 'U', \"\\n[GNUPG:] TRUST_NEVER\" },\n \t{ 'U', \"\\n[GNUPG:] TRUST_UNDEFINED\" },\n+\t{ 'E', \"\\n[GNUPG:] ERRSIG \"},\n+\t{ 'X', \"\\n[GNUPG:] EXPSIG \"},\n+\t{ 'X', \"\\n[GNUPG:] EXPKEYSIG \"},\n+\t{ 'R', \"\\n[GNUPG:] REVKEYSIG \"},\n };\n \n void parse_gpg_output(struct signature_check *sigc)\n@@ -54,9 +58,12 @@ void parse_gpg_output(struct signature_check *sigc)\n \t\t/* The trust messages are not followed by key/signer information */\n \t\tif (sigc->result != 'U') {\n \t\t\tsigc->key = xmemdupz(found, 16);\n-\t\t\tfound += 17;\n-\t\t\tnext = strchrnul(found, '\\n');\n-\t\t\tsigc->signer = xmemdupz(found, next - found);\n+\t\t\t/* The ERRSIG message is not followed by signer information */\n+\t\t\tif (sigc-> result != 'E') {\n+\t\t\t\tfound += 17;\n+\t\t\t\tnext = strchrnul(found, '\\n');\n+\t\t\t\tsigc->signer = xmemdupz(found, next - found);\n+\t\t\t}\n \t\t}\n \t}\n }\ndiff --git a/pretty.c b/pretty.c\nindex 493edb0..39a36cd 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -1232,8 +1232,11 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */\n \t\t\tswitch (c->signature_check.result) {\n \t\t\tcase 'G':\n \t\t\tcase 'B':\n+\t\t\tcase 'E':\n \t\t\tcase 'U':\n \t\t\tcase 'N':\n+\t\t\tcase 'X':\n+\t\t\tcase 'R':\n \t\t\t\tstrbuf_addch(sb, c->signature_check.result);\n \t\t\t}\n \t\t\tbreak;\ndiff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh\nindex 6e839f5..9f487f9 100755\n--- a/t/t7510-signed-commit.sh\n+++ b/t/t7510-signed-commit.sh\n@@ -190,7 +190,7 @@ test_expect_success GPG 'show bad signature with custom format' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG 'show unknown signature with custom format' '\n+test_expect_success GPG 'show untrusted signature with custom format' '\n \tcat >expect <<-\\EOF &&\n \tU\n \t61092E85B7227189\n@@ -200,6 +200,16 @@ test_expect_success GPG 'show unknown signature with custom format' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success GPG 'show unknown signature with custom format' '\n+\tcat >expect <<-\\EOF &&\n+\tE\n+\t61092E85B7227189\n+\n+\tEOF\n+\tGNUPGHOME=\"$HOME/gnupg-home-not-used\" git log -1 --format=\"%G?%n%GK%n%GS\" eighth-signed-alt >actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success GPG 'show lack of signature with custom format' '\n \tcat >expect <<-\\EOF &&\n \tN\n-- \n2.10.0.527.gbcb6904\n\n"},{"id":"302810","messageId":"dc55746d-ccca-e5d5-be08-01082b5610d4@ramsayjones.plus.com","threadId":"44150","inReplyTo":"c4777ef68059034d7ad4697a06bba3cabbdc9265.1475053649.git.git@drmicha.warpmail.net","subject":"Re: [PATCH v2] gpg-interface: use more status letters","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2016-09-28T15:10:10Z","receivedAt":"2016-09-28T15:10:22Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 28/09/16 15:24, Michael J Gruber wrote:\n> According to gpg2's doc/DETAILS:\n> \"For each signature only one of the codes GOODSIG, BADSIG, EXPSIG,\n> EXPKEYSIG, REVKEYSIG or ERRSIG will be emitted.\"\n> \n> gpg1 (\"classic\") behaves the same (although doc/DETAILS\n> differs).\n> \n> Currently, we parse gpg's status output for GOODSIG, BADSIG and trust\n> information and translate that into status codes G, B, U, N for the %G?\n> format specifier.\n> \n> git-verify-* returns success in the GOODSIG case only. This is somewhat in\n> disagreement with gpg, which considers the first 5 of the 6 above as VALIDSIG,\n> but we err on the very safe side.\n> \n> Introduce additional status codes E, X, R for ERRSIG, EXP*SIG, REVKEYSIG\n> so that a user of %G? gets more information about the absence of a 'G'\n> on first glance.\n> \n> Requested-by: Alex <agrambot@gmail.com>\n> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n> ---\n> Changes in v2:\n> \n> - Use GNUPGHOME=\"$HOME/gnupg-home-not-used\" just like in other tests (lib).\n> - Do not parse for signer UID in the ERRSIG case (and test that we do not).\n> - Retreat \"rather\" addition from the doc: good/valid are terms that we use\n>   differently from gpg anyways.\n> \n>  Documentation/pretty-formats.txt |  9 +++++++--\n>  gpg-interface.c                  | 13 ++++++++++---\n>  pretty.c                         |  3 +++\n>  t/t7510-signed-commit.sh         | 12 +++++++++++-\n>  4 files changed, 31 insertions(+), 6 deletions(-)\n> \n> diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\n> index a942d57..c28ff2b 100644\n> --- a/Documentation/pretty-formats.txt\n> +++ b/Documentation/pretty-formats.txt\n> @@ -143,8 +143,13 @@ ifndef::git-rev-list[]\n>  - '%N': commit notes\n>  endif::git-rev-list[]\n>  - '%GG': raw verification message from GPG for a signed commit\n> -- '%G?': show \"G\" for a good (valid) signature, \"B\" for a bad signature,\n> -  \"U\" for a good signature with unknown validity and \"N\" for no signature\n> +- '%G?': show \"G\" for a good (valid) signature,\n> +  \"B\" for a bad signature,\n> +  \"U\" for a good signature with unknown validity,\n> +  \"X\" for a good expired signature, or good signature made by an expired key,\n\nHmm, this looks odd. Would the following:\n\n    \"X\" for a good signature made with an expired key,\n\nmean something different?\n\nATB,\nRamsay Jones\n\n"},{"id":"302833","messageId":"xmqqshsjiyn4.fsf@gitster.mtv.corp.google.com","threadId":"44150","inReplyTo":"c4777ef68059034d7ad4697a06bba3cabbdc9265.1475053649.git.git@drmicha.warpmail.net","subject":"Re: [PATCH v2] gpg-interface: use more status letters","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-28T19:59:27Z","receivedAt":"2016-09-28T19:59:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> - Use GNUPGHOME=\"$HOME/gnupg-home-not-used\" just like in other tests (lib).\n\nIf you are not using /dev/null, I expected you to do\n\n\t. ./test-lib.sh\n\tGNUPGHOME_saved=$GNPGHOME\n        . \"$TEST_DIRECTORY/lib-gpg.sh\"\n\nand then use\n\n\tGNUPGHOME=\"$GNUPGHOME_saved\" git log -1 ...\n\nin the test.\n\nOtherwise, you are not futureproofing your use and only adding to\nmaintenance burden.  The gnupg-home-not-used hack may turn out to be\na problematic and test-lib.sh may update to point to somewhere else,\nwhich will leave your copy still pointing at the old problematic\nplace).\n\n> - Do not parse for signer UID in the ERRSIG case (and test that we do not).\n\nGood.\n\n> - Retreat \"rather\" addition from the doc: good/valid are terms that we use\n>   differently from gpg anyways.\n\nOK.\n\n> +  \"X\" for a good expired signature, or good signature made by an expired key,\n\nAs an attempt to clarify that we cover both EXPSIG and EXPKEYSIG\ncases, I think this is good enough.  I may have phrased the former\nslightly differently, though: \"a good signature that has expired\".\n\nI have no strong opinion if we want to stress that we cover both\ncases, though, which is I think what Ramsay's comment was about.\n\nThanks.\n"},{"id":"302838","messageId":"24ecc903-3e5a-47f6-f073-00a1c709d5e8@ramsayjones.plus.com","threadId":"44150","inReplyTo":"xmqqshsjiyn4.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2] gpg-interface: use more status letters","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2016-09-28T21:09:59Z","receivedAt":"2016-09-28T21:10:08Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 28/09/16 20:59, Junio C Hamano wrote:\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n \n>> +  \"X\" for a good expired signature, or good signature made by an expired key,\n> \n> As an attempt to clarify that we cover both EXPSIG and EXPKEYSIG\n> cases, I think this is good enough.  I may have phrased the former\n> slightly differently, though: \"a good signature that has expired\".\n> \n> I have no strong opinion if we want to stress that we cover both\n> cases, though, which is I think what Ramsay's comment was about.\n\nKinda! ;-)\n\nI'm not sure that it is a good idea to mash both EXPSIG and EXPKEYSIG\ninto one status letter, but I was also fishing for some information\nabout EXPSIG. I was only vaguely aware that a signature could expire\n_independently_ of the key used to do the signing. Also, according to\nhttps://www.gnupg.org/documentation/manuals/gnupg/Automated-signature-checking.html\nfor the EXPSIG case 'Note, that this case is currently not implemented.'\n\nHmm, I guess these are so closely related that a single status letter\nis OK, but I think I would prefer your phrasing; namely:\n\n \"X\" for a good signature that has expired, or a good signature made with an expired key,\n\n[Although that is still a bit cumbersome.]\n\nATB,\nRamsay Jones\n\n\n"},{"id":"302984","messageId":"f167f869-ca31-efed-b9a6-1d9cde8d68ef@drmicha.warpmail.net","threadId":"44150","inReplyTo":"xmqqshsjiyn4.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2] gpg-interface: use more status letters","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2016-09-30T09:33:05Z","receivedAt":"2016-09-30T09:33:39Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Junio C Hamano venit, vidit, dixit 28.09.2016 21:59:\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n> \n>> - Use GNUPGHOME=\"$HOME/gnupg-home-not-used\" just like in other tests (lib).\n> \n> If you are not using /dev/null, I expected you to do\n> \n> \t. ./test-lib.sh\n> \tGNUPGHOME_saved=$GNPGHOME\n>         . \"$TEST_DIRECTORY/lib-gpg.sh\"\n> \n> and then use\n> \n> \tGNUPGHOME=\"$GNUPGHOME_saved\" git log -1 ...\n> \n> in the test.\n> \n> Otherwise, you are not futureproofing your use and only adding to\n> maintenance burden.  The gnupg-home-not-used hack may turn out to be\n> a problematic and test-lib.sh may update to point to somewhere else,\n> which will leave your copy still pointing at the old problematic\n> place).\n\nWell, I understood you told me to do what test-lib.sh does.\n\nYou obviously wanted me to piggy-bak on test-lib.sh's behavior instead.\n\nI don't know what's more likely to break - the latter relies on\ntest-lib.sh's setting GNUPGHOME to a non existing gpg home, which is\nsomething funny to do if you don't even plan to use gpg.\n\n>> - Do not parse for signer UID in the ERRSIG case (and test that we do not).\n> \n> Good.\n> \n>> - Retreat \"rather\" addition from the doc: good/valid are terms that we use\n>>   differently from gpg anyways.\n> \n> OK.\n> \n>> +  \"X\" for a good expired signature, or good signature made by an expired key,\n> \n> As an attempt to clarify that we cover both EXPSIG and EXPKEYSIG\n> cases, I think this is good enough.  I may have phrased the former\n> slightly differently, though: \"a good signature that has expired\".\n> \n> I have no strong opinion if we want to stress that we cover both\n> cases, though, which is I think what Ramsay's comment was about.\n\nI'll comment in the reply to his 2nd e-mail....\n\nMichael\n\n\n"},{"id":"302985","messageId":"85fa6296-17f0-0e8c-ec1b-54cd48c45223@drmicha.warpmail.net","threadId":"44150","inReplyTo":"24ecc903-3e5a-47f6-f073-00a1c709d5e8@ramsayjones.plus.com","subject":"Re: [PATCH v2] gpg-interface: use more status letters","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2016-09-30T09:41:11Z","receivedAt":"2016-09-30T09:41:18Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Ramsay Jones venit, vidit, dixit 28.09.2016 23:09:\n> \n> \n> On 28/09/16 20:59, Junio C Hamano wrote:\n>> Michael J Gruber <git@drmicha.warpmail.net> writes:\n>  \n>>> +  \"X\" for a good expired signature, or good signature made by an expired key,\n>>\n>> As an attempt to clarify that we cover both EXPSIG and EXPKEYSIG\n>> cases, I think this is good enough.  I may have phrased the former\n>> slightly differently, though: \"a good signature that has expired\".\n>>\n>> I have no strong opinion if we want to stress that we cover both\n>> cases, though, which is I think what Ramsay's comment was about.\n> \n> Kinda! ;-)\n> \n> I'm not sure that it is a good idea to mash both EXPSIG and EXPKEYSIG\n> into one status letter, but I was also fishing for some information\n> about EXPSIG. I was only vaguely aware that a signature could expire\n> _independently_ of the key used to do the signing. Also, according to\n> https://www.gnupg.org/documentation/manuals/gnupg/Automated-signature-checking.html\n> for the EXPSIG case 'Note, that this case is currently not implemented.'\n\nA key can have an expiration date.\n\nA signature can have an expiration date.\n\nThe \"goodness\" of a signature is independent of the expiraton dates.\n\nSignature expiration is implemented, I tested that (gpg 1 aka \"classic\").\n\n> Hmm, I guess these are so closely related that a single status letter\n> is OK, but I think I would prefer your phrasing; namely:\n> \n>  \"X\" for a good signature that has expired, or a good signature made with an expired key,\n> \n\nI'm open to whatever phrasing you deem clearer.\n\nAlso, I'm open to using another letter for EXPKEYSIG but couldn't decide\nbetween 'Y', 'Z', 'K'. 'K' could be confused with REVKEYSIG, I'm afraid.\n'Y' is next to 'X' and contained in 'KEY', it would be my first choice.\n\nCheers,\nMichael\n\n"},{"id":"302987","messageId":"xmqq60pdbbxh.fsf@gitster.mtv.corp.google.com","threadId":"44150","inReplyTo":"85fa6296-17f0-0e8c-ec1b-54cd48c45223@drmicha.warpmail.net","subject":"Re: [PATCH v2] gpg-interface: use more status letters","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-30T16:16:26Z","receivedAt":"2016-09-30T16:16:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> Also, I'm open to using another letter for EXPKEYSIG but couldn't decide\n> between 'Y', 'Z', 'K'. 'K' could be confused with REVKEYSIG, I'm afraid.\n> 'Y' is next to 'X' and contained in 'KEY', it would be my first choice.\n\nSounds good enough to me.  Thanks.\n"},{"id":"303535","messageId":"xmqqk2dli25w.fsf@gitster.mtv.corp.google.com","threadId":"44150","inReplyTo":"xmqq60pdbbxh.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2] gpg-interface: use more status letters","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-06T21:43:39Z","receivedAt":"2016-10-06T21:43:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n>\n>> Also, I'm open to using another letter for EXPKEYSIG but couldn't decide\n>> between 'Y', 'Z', 'K'. 'K' could be confused with REVKEYSIG, I'm afraid.\n>> 'Y' is next to 'X' and contained in 'KEY', it would be my first choice.\n>\n> Sounds good enough to me.  Thanks.\n\nI really do not want to leave too many topics listed in the \"What's\ncooking\" report to be in undecided / waiting state.  How about\nsquashing this in, with a fully updated log message to replace?\n\n-- >8 --\nFrom: Michael J Gruber <git@drmicha.warpmail.net>\nDate: Wed, 28 Sep 2016 16:24:13 +0200\nSubject: [PATCH] SQUASH: gpg-interface: use more status letters\n\nAccording to gpg2's doc/DETAILS:\n\n    For each signature only one of the codes GOODSIG, BADSIG,\n    EXPSIG, EXPKEYSIG, REVKEYSIG or ERRSIG will be emitted.\n\ngpg1 (\"classic\") behaves the same (although doc/DETAILS differs).\n\nCurrently, we parse gpg's status output for GOODSIG, BADSIG and\ntrust information and translate that into status codes G, B, U, N\nfor the %G?  format specifier.\n\ngit-verify-* returns success in the GOODSIG case only. This is\nsomewhat in disagreement with gpg, which considers the first 5 of\nthe 6 above as VALIDSIG, but we err on the very safe side.\n\nIntroduce additional status codes E, X, Y, R for ERRSIG, EXPSIG,\nEXPKEYSIG, and REVKEYSIG so that a user of %G? gets more information\nabout the absence of a 'G' on first glance.\n\nRequested-by: Alex <agrambot@gmail.com>\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/pretty-formats.txt | 3 ++-\n gpg-interface.c                  | 2 +-\n pretty.c                         | 1 +\n 3 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\nindex c28ff2b919..179c9389aa 100644\n--- a/Documentation/pretty-formats.txt\n+++ b/Documentation/pretty-formats.txt\n@@ -146,7 +146,8 @@ endif::git-rev-list[]\n - '%G?': show \"G\" for a good (valid) signature,\n   \"B\" for a bad signature,\n   \"U\" for a good signature with unknown validity,\n-  \"X\" for a good expired signature, or good signature made by an expired key,\n+  \"X\" for a good signature that has expired,\n+  \"Y\" for a good signature made by an expired key,\n   \"R\" for a good signature made by a revoked key,\n   \"E\" if the signature cannot be checked (e.g. missing key)\n   and \"N\" for no signature\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 6999e7b469..e44cc27da1 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -35,7 +35,7 @@ static struct {\n \t{ 'U', \"\\n[GNUPG:] TRUST_UNDEFINED\" },\n \t{ 'E', \"\\n[GNUPG:] ERRSIG \"},\n \t{ 'X', \"\\n[GNUPG:] EXPSIG \"},\n-\t{ 'X', \"\\n[GNUPG:] EXPKEYSIG \"},\n+\t{ 'Y', \"\\n[GNUPG:] EXPKEYSIG \"},\n \t{ 'R', \"\\n[GNUPG:] REVKEYSIG \"},\n };\n \ndiff --git a/pretty.c b/pretty.c\nindex 39a36cd825..f98b271069 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -1236,6 +1236,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */\n \t\t\tcase 'U':\n \t\t\tcase 'N':\n \t\t\tcase 'X':\n+\t\t\tcase 'Y':\n \t\t\tcase 'R':\n \t\t\t\tstrbuf_addch(sb, c->signature_check.result);\n \t\t\t}\n-- \n2.10.1-520-ge127bfd383\n\n"},{"id":"303719","messageId":"8e496061-ce6c-450f-7c9e-785572d50b79@drmicha.warpmail.net","threadId":"44150","inReplyTo":"xmqqk2dli25w.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2] gpg-interface: use more status letters","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2016-10-10T12:59:49Z","receivedAt":"2016-10-10T13:00:16Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Junio C Hamano venit, vidit, dixit 06.10.2016 23:43:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n>> Michael J Gruber <git@drmicha.warpmail.net> writes:\n>>\n>>> Also, I'm open to using another letter for EXPKEYSIG but couldn't decide\n>>> between 'Y', 'Z', 'K'. 'K' could be confused with REVKEYSIG, I'm afraid.\n>>> 'Y' is next to 'X' and contained in 'KEY', it would be my first choice.\n>>\n>> Sounds good enough to me.  Thanks.\n> \n> I really do not want to leave too many topics listed in the \"What's\n> cooking\" report to be in undecided / waiting state.  How about\n> squashing this in, with a fully updated log message to replace?\n\nSorry, this got \"lost in vacation\". Before that, I was looking for an\neasy way to test expired signatures, but gpg1 and gpg2 behave somewhat\ndifferently in that respect (2 does not allow to create already expired\nsignatures).\n\nIs there anything I should or could do now?\n\nMichael\n\n> -- >8 --\n> From: Michael J Gruber <git@drmicha.warpmail.net>\n> Date: Wed, 28 Sep 2016 16:24:13 +0200\n> Subject: [PATCH] SQUASH: gpg-interface: use more status letters\n> \n> According to gpg2's doc/DETAILS:\n> \n>     For each signature only one of the codes GOODSIG, BADSIG,\n>     EXPSIG, EXPKEYSIG, REVKEYSIG or ERRSIG will be emitted.\n> \n> gpg1 (\"classic\") behaves the same (although doc/DETAILS differs).\n> \n> Currently, we parse gpg's status output for GOODSIG, BADSIG and\n> trust information and translate that into status codes G, B, U, N\n> for the %G?  format specifier.\n> \n> git-verify-* returns success in the GOODSIG case only. This is\n> somewhat in disagreement with gpg, which considers the first 5 of\n> the 6 above as VALIDSIG, but we err on the very safe side.\n> \n> Introduce additional status codes E, X, Y, R for ERRSIG, EXPSIG,\n> EXPKEYSIG, and REVKEYSIG so that a user of %G? gets more information\n> about the absence of a 'G' on first glance.\n> \n> Requested-by: Alex <agrambot@gmail.com>\n> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  Documentation/pretty-formats.txt | 3 ++-\n>  gpg-interface.c                  | 2 +-\n>  pretty.c                         | 1 +\n>  3 files changed, 4 insertions(+), 2 deletions(-)\n> \n> diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\n> index c28ff2b919..179c9389aa 100644\n> --- a/Documentation/pretty-formats.txt\n> +++ b/Documentation/pretty-formats.txt\n> @@ -146,7 +146,8 @@ endif::git-rev-list[]\n>  - '%G?': show \"G\" for a good (valid) signature,\n>    \"B\" for a bad signature,\n>    \"U\" for a good signature with unknown validity,\n> -  \"X\" for a good expired signature, or good signature made by an expired key,\n> +  \"X\" for a good signature that has expired,\n> +  \"Y\" for a good signature made by an expired key,\n>    \"R\" for a good signature made by a revoked key,\n>    \"E\" if the signature cannot be checked (e.g. missing key)\n>    and \"N\" for no signature\n> diff --git a/gpg-interface.c b/gpg-interface.c\n> index 6999e7b469..e44cc27da1 100644\n> --- a/gpg-interface.c\n> +++ b/gpg-interface.c\n> @@ -35,7 +35,7 @@ static struct {\n>  \t{ 'U', \"\\n[GNUPG:] TRUST_UNDEFINED\" },\n>  \t{ 'E', \"\\n[GNUPG:] ERRSIG \"},\n>  \t{ 'X', \"\\n[GNUPG:] EXPSIG \"},\n> -\t{ 'X', \"\\n[GNUPG:] EXPKEYSIG \"},\n> +\t{ 'Y', \"\\n[GNUPG:] EXPKEYSIG \"},\n>  \t{ 'R', \"\\n[GNUPG:] REVKEYSIG \"},\n>  };\n>  \n> diff --git a/pretty.c b/pretty.c\n> index 39a36cd825..f98b271069 100644\n> --- a/pretty.c\n> +++ b/pretty.c\n> @@ -1236,6 +1236,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */\n>  \t\t\tcase 'U':\n>  \t\t\tcase 'N':\n>  \t\t\tcase 'X':\n> +\t\t\tcase 'Y':\n>  \t\t\tcase 'R':\n>  \t\t\t\tstrbuf_addch(sb, c->signature_check.result);\n>  \t\t\t}\n> \n\n"},{"id":"303771","messageId":"xmqqtwckf5mg.fsf@gitster.mtv.corp.google.com","threadId":"44150","inReplyTo":"8e496061-ce6c-450f-7c9e-785572d50b79@drmicha.warpmail.net","subject":"Re: [PATCH v2] gpg-interface: use more status letters","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-10T17:58:31Z","receivedAt":"2016-10-10T17:58:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> Sorry, this got \"lost in vacation\". Before that, I was looking for an\n> easy way to test expired signatures, but gpg1 and gpg2 behave somewhat\n> differently in that respect (2 does not allow to create already expired\n> signatures).\n>\n> Is there anything I should or could do now?\n\nI dunno.  It's your itch.\n\nYou can say \"I'll need more time to figure out the way to test what\nI am not testing here, so do not merge it to 'next' yet\".\n\nYou can also say \"This is good enough for now, so go ahead and merge\nit to 'next'; more detailed tests can be done as follow-up patches\nif needed\".\n\nYou can also say \"Thinking about it again, there is no strong reason\nwhy we need to differentiate EXPSIG and EXPKEYSIG, so don't do this\nSQUASH and use my original one as-is\".\n\nI'd be happy with any of the above and there may be other ones I'd\nbe happy with that I haven't thought of ;-)\n"},{"id":"303983","messageId":"a163120834c93482102cd616167bc2539d4e696d.1476271382.git.git@drmicha.warpmail.net","threadId":"44150","inReplyTo":"xmqqtwckf5mg.fsf@gitster.mtv.corp.google.com","subject":"[PATCH v3] gpg-interface: use more status letters","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2016-10-12T13:04:15Z","receivedAt":"2016-10-12T13:04:56Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"According to gpg2's doc/DETAILS:\n\n    For each signature only one of the codes GOODSIG, BADSIG,\n    EXPSIG, EXPKEYSIG, REVKEYSIG or ERRSIG will be emitted.\n\ngpg1 (\"classic\") behaves the same (although doc/DETAILS differs).\n\nCurrently, we parse gpg's status output for GOODSIG, BADSIG and\ntrust information and translate that into status codes G, B, U, N\nfor the %G?  format specifier.\n\ngit-verify-* returns success in the GOODSIG case only. This is\nsomewhat in disagreement with gpg, which considers the first 5 of\nthe 6 above as VALIDSIG, but we err on the very safe side.\n\nIntroduce additional status codes E, X, Y, R for ERRSIG, EXPSIG,\nEXPKEYSIG, and REVKEYSIG so that a user of %G? gets more information\nabout the absence of a 'G' on first glance.\n\nRequested-by: Alex <agrambot@gmail.com>\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nv3 incorporates Junios' changes to the commit message, as well as his\nsuggestion how to use an undefined gpghome the way test-lib does.\nAlso, all Y-related changes (including the if in pretty.c).\n\nTesting X, Y, and R from our test scripts is somewhat problematic\n(some gpg versions do not allow back-dating, and we cannot ship pre-made\nsignatures easily) but I have tested all of them locally.\n\n Documentation/pretty-formats.txt | 10 ++++++++--\n gpg-interface.c                  | 13 ++++++++++---\n pretty.c                         |  4 ++++\n t/t7510-signed-commit.sh         | 13 ++++++++++++-\n 4 files changed, 34 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\nindex a942d57f73..179c9389aa 100644\n--- a/Documentation/pretty-formats.txt\n+++ b/Documentation/pretty-formats.txt\n@@ -143,8 +143,14 @@ ifndef::git-rev-list[]\n - '%N': commit notes\n endif::git-rev-list[]\n - '%GG': raw verification message from GPG for a signed commit\n-- '%G?': show \"G\" for a good (valid) signature, \"B\" for a bad signature,\n-  \"U\" for a good signature with unknown validity and \"N\" for no signature\n+- '%G?': show \"G\" for a good (valid) signature,\n+  \"B\" for a bad signature,\n+  \"U\" for a good signature with unknown validity,\n+  \"X\" for a good signature that has expired,\n+  \"Y\" for a good signature made by an expired key,\n+  \"R\" for a good signature made by a revoked key,\n+  \"E\" if the signature cannot be checked (e.g. missing key)\n+  and \"N\" for no signature\n - '%GS': show the name of the signer for a signed commit\n - '%GK': show the key used to sign a signed commit\n - '%gD': reflog selector, e.g., `refs/stash@{1}` or\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 8672edaf48..e44cc27da1 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -33,6 +33,10 @@ static struct {\n \t{ 'B', \"\\n[GNUPG:] BADSIG \" },\n \t{ 'U', \"\\n[GNUPG:] TRUST_NEVER\" },\n \t{ 'U', \"\\n[GNUPG:] TRUST_UNDEFINED\" },\n+\t{ 'E', \"\\n[GNUPG:] ERRSIG \"},\n+\t{ 'X', \"\\n[GNUPG:] EXPSIG \"},\n+\t{ 'Y', \"\\n[GNUPG:] EXPKEYSIG \"},\n+\t{ 'R', \"\\n[GNUPG:] REVKEYSIG \"},\n };\n \n void parse_gpg_output(struct signature_check *sigc)\n@@ -54,9 +58,12 @@ void parse_gpg_output(struct signature_check *sigc)\n \t\t/* The trust messages are not followed by key/signer information */\n \t\tif (sigc->result != 'U') {\n \t\t\tsigc->key = xmemdupz(found, 16);\n-\t\t\tfound += 17;\n-\t\t\tnext = strchrnul(found, '\\n');\n-\t\t\tsigc->signer = xmemdupz(found, next - found);\n+\t\t\t/* The ERRSIG message is not followed by signer information */\n+\t\t\tif (sigc-> result != 'E') {\n+\t\t\t\tfound += 17;\n+\t\t\t\tnext = strchrnul(found, '\\n');\n+\t\t\t\tsigc->signer = xmemdupz(found, next - found);\n+\t\t\t}\n \t\t}\n \t}\n }\ndiff --git a/pretty.c b/pretty.c\nindex 25efbcac92..d89ca30911 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -1232,8 +1232,12 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */\n \t\t\tswitch (c->signature_check.result) {\n \t\t\tcase 'G':\n \t\t\tcase 'B':\n+\t\t\tcase 'E':\n \t\t\tcase 'U':\n \t\t\tcase 'N':\n+\t\t\tcase 'X':\n+\t\t\tcase 'Y':\n+\t\t\tcase 'R':\n \t\t\t\tstrbuf_addch(sb, c->signature_check.result);\n \t\t\t}\n \t\t\tbreak;\ndiff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh\nindex 6e839f5489..762135adea 100755\n--- a/t/t7510-signed-commit.sh\n+++ b/t/t7510-signed-commit.sh\n@@ -2,6 +2,7 @@\n \n test_description='signed commit tests'\n . ./test-lib.sh\n+GNUPGHOME_NOT_USED=$GNUPGHOME\n . \"$TEST_DIRECTORY/lib-gpg.sh\"\n \n test_expect_success GPG 'create signed commits' '\n@@ -190,7 +191,7 @@ test_expect_success GPG 'show bad signature with custom format' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG 'show unknown signature with custom format' '\n+test_expect_success GPG 'show untrusted signature with custom format' '\n \tcat >expect <<-\\EOF &&\n \tU\n \t61092E85B7227189\n@@ -200,6 +201,16 @@ test_expect_success GPG 'show unknown signature with custom format' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success GPG 'show unknown signature with custom format' '\n+\tcat >expect <<-\\EOF &&\n+\tE\n+\t61092E85B7227189\n+\n+\tEOF\n+\tGNUPGHOME=\"$GNUPGHOME_NOT_USED\" git log -1 --format=\"%G?%n%GK%n%GS\" eighth-signed-alt >actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success GPG 'show lack of signature with custom format' '\n \tcat >expect <<-\\EOF &&\n \tN\n-- \n2.10.1.532.gfe29b57\n\n"}]}