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

Re: [PATCH] git-for-each-ref: move GPG sigs off %(body) to %(signature).

From
Jeff King <peff@peff.net>
Date
Aug 30, 2011, 16:27 UTC
Message-ID
<20110830162743.GB15790@sigill.intra.peff.net>
In-Reply-To
<4E5CB0D0.7000905@drmicha.warpmail.net>
On Tue, Aug 30, 2011 at 11:43:44AM +0200, Michael J Gruber wrote:
Show 10 quoted lines
> > When grabbing a %(body) or %(contents) off a tag, one doesn't really
> > expect to get the GPG signature as well (as it's basically useless
> > without the complete signed text). Thus, strip it off those two tags,
> > and make available via %(signature) if anyone needs it.
> 
> No, please do not change %(contents). It is the complete content which
> (together with the header) enters into the sha1 calculation.
> 
> You will probably also face opposition as regards to %(body), changing
> existing behaviour.

Yeah. If it were 2005, I think it might make sense to have non-overlapping individual keys to get each part of the tag. But it's not worth breaking backwards compatibility of "%(body)" today. So it has to remain as-is, and we have to introduce a new key for "the body without the signature".

Show 6 quoted lines
> In fact, I wish we didn't have %(body) but %(contents:body) just like
> other modifiers such as :short.
> 
> I think I'd go for
> 
> %(contents:signature)

That makes some sense to me, though it is a little weird that the ":signature" modifier works only for tags, and not commits. In other cases, whole keys either work or don't work (e.g., "taggerdate"). But I guess it is not that big a deal.

> %(contents:subject) the same as %(subject)
> %(contents:body) as contents minus subject minus signature
> 
> and slowly deprecate %(subject) and %(body) (simply un-document for now).

That leaves no way to get what "%(body)" provides now, right? I wonder if anyone cares. You can always ask for:

  %(contents:body)%(contents:signature)
I guess.
Show 8 quoted lines
> > +	/* look for GPG signature */
> 
> Again I have to say no. Please look at
> 
> 3d5854e (tag: recognize rfc1991 signatures, 2010-11-10)
> 
> which uses the factored out signature detection as introduced in the
> previous commits. Thanks!
Yeah. More correct, and it's less code, too. :)
-Peff
Previous: Michał GórnyNext: Michał Górny
Message 9 of 32 in “More formatting with 'git tag -l'”
  1. Michał GórnyAug 29, 2011
  2. Jeff KingAug 29, 2011
  3. Michał GórnyAug 29, 2011
  4. Jeff KingAug 29, 2011
  5. Michał GórnyAug 29, 2011
  6. git-for-each-ref: move GPG sigs off %(body) to %(signature).Michał Górny, Aug 30, 2011
  7. Michael J GruberAug 30, 2011
  8. Michał GórnyAug 30, 2011
  9. Jeff KingAug 30, 2011
  10. for-each-ref: add split message parts to %(contents:*).Michał Górny, Aug 31, 2011
  11. Jeff KingAug 31, 2011
  12. 1/2 t7004: factor out gpg setupJeff King, Aug 31, 2011
  13. 2/2 t6300: test new content:* for-each-ref placeholdersJeff King, Aug 31, 2011
  14. Junio C HamanoAug 31, 2011
  15. Jeff KingAug 31, 2011
  16. Michał GórnySep 1, 2011
  17. Junio C HamanoSep 1, 2011
  18. Jeff KingSep 1, 2011
  19. Michał GórnySep 1, 2011
  20. for-each-ref: add split message parts to %(contents:*).Michał Górny, Sep 1, 2011
  21. Jeff KingSep 2, 2011
  22. Michał GórnySep 2, 2011
  23. Jeff KingSep 2, 2011
  24. Jeff KingSep 7, 2011
  25. Michał GórnySep 15, 2011
  26. 1/5 t7004: factor out gpg setupJeff King, Sep 7, 2011
  27. 2/5 t6300: add more body-parsing testsJeff King, Sep 7, 2011
  28. 3/5 for-each-ref: refactor subject and body placeholder parsingJeff King, Sep 7, 2011
  29. 4/5 for-each-ref: handle multiline subjects like --prettyJeff King, Sep 7, 2011
  30. 5/5 for-each-ref: add split message parts to %(contents:*).Jeff King, Sep 7, 2011
  31. Junio C HamanoSep 1, 2011
  32. Jeff KingSep 1, 2011

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.