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

Re: [PATCH] gpg-interface: use more status letters

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 27, 2016, 17:25 UTC
Message-ID
<xmqqk2dxp84i.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<06b5e0bfb898c7b3c6a866df5bda0ab4587284c6.1474986563.git.git@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 21 quoted lines
> According to gpg2's doc/DETAILS:
> "For each signature only one of the codes GOODSIG, BADSIG, EXPSIG,
> EXPKEYSIG, REVKEYSIG or ERRSIG will be emitted."
>
> gpg1 ("classic") behaves the same (although doc/DETAILS
> differs).
>
> Currently, we parse gpg's status output for GOODSIG, BADSIG and trust
> information and translate that into status codes G, B, U, N for the %G?
> format specifier.
>
> git-verify-* returns success in the GOODSIG case only. This is somewhat in
> disagreement with gpg, which considers the first 5 of the 6 above as VALIDSIG,
> but we err on the very safe side.
>
> Introduce additional status codes E, X, R for ERRSIG, EXP*SIG, REVKEYSIG
> so that a user of %G? gets more information about the absence of a 'G'
> on first glance.
>
> Reported-by: Alex <agrambot@gmail.com>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
That probably was requested-by, but that's OK.
> I'd be happy to learn are more portable/safer/cooler way to make gpg forget
> that key in the added test...

We seem to set GNUPGHOME to $HOME/gnupg-home-not-used in test-lib.sh to say "No gnupg keys for you!" for all the tests by default, which is overriden by the signature tests like 7510. I do not know if that is more portable/safer/cooler than setting it to /dev/null but imitating it might be a way for you to push the potential problem away to other people ;-) If it becomes an issue to set it to a directory that does not exist with an updated future version of GPG, this new test will share the same problem with everybody else, and hopefully the solution would be the same ;-)

Having said that, if GNUPGHOME=/dev/null works for you, that's good enough for now, so that people on other platforms can test it and report.

Thanks.
Show 29 quoted lines
> diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
> index 6e839f5..fd22742 100755
> --- a/t/t7510-signed-commit.sh
> +++ b/t/t7510-signed-commit.sh
> @@ -190,7 +190,7 @@ test_expect_success GPG 'show bad signature with custom format' '
>  	test_cmp expect actual
>  '
>  
> -test_expect_success GPG 'show unknown signature with custom format' '
> +test_expect_success GPG 'show untrusted signature with custom format' '
>  	cat >expect <<-\EOF &&
>  	U
>  	61092E85B7227189
> @@ -200,6 +200,15 @@ test_expect_success GPG 'show unknown signature with custom format' '
>  	test_cmp expect actual
>  '
>  
> +test_expect_success GPG 'show unknown signature with custom format' '
> +	cat >expect <<-\EOF &&
> +	E
> +	61092E85B7227189
> +	EOF
> +	GNUPGHOME=/dev/null git log -1 --format="%G?%n%GK" eighth-signed-alt >actual &&
> +	test_cmp expect actual
> +'
> +
>  test_expect_success GPG 'show lack of signature with custom format' '
>  	cat >expect <<-\EOF &&
>  	N
Previous: Michael J GruberNext: Michael J Gruber
Message 5 of 16 in “Request: Extra case for %G? format”
  1. AlexSep 25, 2016
  2. Michael J GruberSep 26, 2016
  3. AlexSep 26, 2016
  4. gpg-interface: use more status lettersMichael J Gruber, Sep 27, 2016
  5. Junio C HamanoSep 27, 2016
  6. gpg-interface: use more status lettersMichael J Gruber, Sep 28, 2016
  7. Ramsay JonesSep 28, 2016
  8. Junio C HamanoSep 28, 2016
  9. Ramsay JonesSep 28, 2016
  10. Michael J GruberSep 30, 2016
  11. Junio C HamanoSep 30, 2016
  12. Junio C HamanoOct 6, 2016
  13. Michael J GruberOct 10, 2016
  14. Junio C HamanoOct 10, 2016
  15. gpg-interface: use more status lettersMichael J Gruber, Oct 12, 2016
  16. Michael J GruberSep 30, 2016

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.