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

Re: [PATCH v12 11/11] Documentation: add documentation for 'git interpret-trailers'

From
Junio C Hamano <gitster@pobox.com>
Date
May 28, 2014, 19:44 UTC
Message-ID
<xmqqa9a1d6xn.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140525053223.5329.28002.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
Show 12 quoted lines
> +trailer.<token>.key::
> +	This `key` will be used instead of <token> in the
> +	trailer. After the last alphanumeric character, this variable
> +	can contain some non alphanumeric characters, like for example
> +	`'%'` (one percent sign), `' = '` (one space followed by one
> +	equal sign and then one space), `' #'` (one space followed by
> +	one number sign) or even just `' '` (one space), that will be
> +	used to separate the <token> from the <value> in the
> +	trailer. The default separator, `': '` (one colon followed by
> +	one space), which is the usual standard, is added only if the
> +	last character in `key` is alphanumeric, so watch out for
> +	unwanted trailing spaces in this variable.

Perhaps corollary to the other review comment to this patch, I think this is overly complex without giving more value to the users than it causes confusion.

If the goal is to allow random syntax on the output side, why do you even need to list percent, pound, etc., when you can just say "The key is emitted and then your value" and the user will get exactly what they specified to be emitted?

Any magic applied on top (namely, we would add ": " only in certain circumstances) only makes things unnecessarily complex; I think your having to say "so watch out for..." is a clear indication of that.

If we use the "separator", so that we can recognise a line with an unseen key as a trailer we do not know about, we should stick to just a single standard one ':' and I think it is OK to add a missing ": " by magic if that is the direction we are going to take, though.

Previous: Junio C HamanoNext: Jakub Narębski
Message 17 of 19 in “Add interpret-trailers builtin”
  1. 00/11 Add interpret-trailers builtinChristian Couder, May 25, 2014
  2. 01/11 trailer: add data structures and basic functionsChristian Couder, May 25, 2014
  3. 02/11 trailer: process trailers from input message and argumentsChristian Couder, May 25, 2014
  4. 03/11 trailer: read and process config informationChristian Couder, May 25, 2014
  5. 04/11 trailer: process command line trailer argumentsChristian Couder, May 25, 2014
  6. 05/11 trailer: parse trailers from file or stdinChristian Couder, May 25, 2014
  7. 06/11 trailer: put all the processing together and printChristian Couder, May 25, 2014
  8. 07/11 trailer: add interpret-trailers commandChristian Couder, May 25, 2014
  9. 08/11 trailer: add tests for "git interpret-trailers"Christian Couder, May 25, 2014
  10. Junio C HamanoMay 28, 2014
  11. 09/11 trailer: execute command from 'trailer.<name>.command'Christian Couder, May 25, 2014
  12. 10/11 trailer: add tests for commands in config fileChristian Couder, May 25, 2014
  13. 11/11 Documentation: add documentation for 'git interpret-trailers'Christian Couder, May 25, 2014
  14. Junio C HamanoMay 28, 2014
  15. Christian CouderJun 29, 2014
  16. Junio C HamanoJun 30, 2014
  17. Junio C HamanoMay 28, 2014
  18. Jakub NarębskiJun 30, 2014
  19. Christian CouderJul 1, 2014

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.