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

[PATCH 0/2] add format specifiers to display trailers

From
Jacob Keller <jacob.e.keller@intel.com>
Date
Nov 18, 2016, 23:08 UTC
Message-ID
<20161118230825.20952-1-jacob.e.keller@intel.com>
From: Jacob Keller <jacob.keller@gmail.com>

This is based off of jt/use-trailer-api-in-commands so that we can make use of the public trailer API that will parse a string for trailers.

I use trailers as a way to store extra commit metadata, and would like a convenient way to obtain the trailers of a commit message easily. This adds format specifiers to both the ref-filter API and the pretty formats. I am not a fan of %bT but %t and %T were already taken. I don't really know if it's ok to use %bT, since I think we used to allow "%bT" format, though i don't think this is likely used much in practice.

I am open to suggestions for the pretty format specifier.

Additionally, I am somewhat not a fan of the way that if you have a series of trailers which are trailer format, but not recognized, such as the following:

<text>
My-tag: my value
My-other-tag: my other value
[non-trailer line]
My-tag: my third value
---

Git interpret-trailers will not recognize this as a trailer block because it doesn't have any standard git tags within it. Would it be ok to augment the trailer interpretation to say that if we have over 75% trailers in the block that we accept it even if it doesn't have any real recognized tags?

I say this because I regularly use extra tags in my git projects to represent change metadata, and it would be nice if the tag block could be recognized even if it has 1-2 lines of non-trailer formatting in it...

Thoughts?
Jacob Keller (2):
  pretty: add %bT format for displaying trailers of a commit message
  ref-filter: add support to display trailers as part of contents
 Documentation/git-for-each-ref.txt |  2 ++
 Documentation/pretty-formats.txt   |  1 +
 pretty.c                           | 18 ++++++++++++++++++
 ref-filter.c                       | 22 +++++++++++++++++++++-
 t/t4205-log-pretty-formats.sh      | 26 ++++++++++++++++++++++++++
 t/t6300-for-each-ref.sh            | 26 ++++++++++++++++++++++++++
 6 files changed, 94 insertions(+), 1 deletion(-)
-- 
2.11.0.rc2.152.g4d04e67
Next: Jacob Keller
Message 1 of 9 in “add format specifiers to display trailers”
  1. 0/2 add format specifiers to display trailersJacob Keller, Nov 18, 2016
  2. 1/2 pretty: add %bT format for displaying trailers of a commit messageJacob Keller, Nov 18, 2016
  3. 2/2 ref-filter: add support to display trailers as part of contentsJacob Keller, Nov 18, 2016
  4. Junio C HamanoNov 18, 2016
  5. Jacob KellerNov 18, 2016
  6. Junio C HamanoNov 21, 2016
  7. Keller, Jacob ENov 29, 2016
  8. doc: mention user-configured trailersJonathan Tan, Nov 21, 2016
  9. Junio C HamanoNov 21, 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.