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

Re: Request: Extra case for %G? format

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Sep 26, 2016, 11:53 UTC
Message-ID
<f056af47-ca98-b35c-e343-9f246c0c8f5b@drmicha.warpmail.net>
In-Reply-To
<87d1js1pl1.fsf@gmail.com>
Alex venit, vidit, dixit 25.09.2016 08:05:
Show 10 quoted lines
> Hello all,
> 
> Could the %G? format differentiate between an unsigned commit and a
> signed commit that you're missing a public key for?
> 
> If `git show --format=%GG --no-patch <commit>' produces an output like
> the following:
> 
> gpg: Signature made <date> using RSA key ID <id>
> gpg: Can't check signature: public key not found

That is the "raw verification message from GPG for a signed commit" as per git-log(1).

> Then currently %G? results in `N', the same as an unsigned commit.
> 
> In this case, could %G? please result in a new character? Perhaps `M'
> for "missing public key"?
Yes, and no.

Really, there are many different reasons why a signature couldn't be checked, but gpg itself has these status results:

"For each signature only one of the three codes GOODSIG, BADSIG or ERRSIG will be emitted" (doc/DETAILS in gpg's source).

ERRSIG comes with additional info (RC) that could be parsed for the reason.

Also, in addition to that line, there can be other lines with additional information. So there is a lot that could potentially be shown (and *is* shown with %GG). In the GOODSIG case, we parse the TRUST info to take the trust model into account (and return U for untrusted good).

I wouldn't mind adding E to %G? in the ERRSIG case, even though one has to look at %GG in any case (N or E) if one wants to have more details.

Cheers, Michael

Previous: AlexNext: Alex
Message 2 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.