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

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

From
Christian Couder <christian.couder@gmail.com>
Date
Apr 7, 2014, 09:39 UTC
Message-ID
<CAP8UFD38TE=5zxvkDvLRsDTpC6zDo6EN5q_HJMQPbUBcfJVsSg@mail.gmail.com>
In-Reply-To
<xmqqk3b4ogwu.fsf@gitster.dls.corp.google.com>
On Sat, Apr 5, 2014 at 12:42 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Christian Couder <christian.couder@gmail.com> writes:
>> "The following features are planned but not yet implemented:
>>         - add more tests related to commands
>>         - add examples in documentation
>>         - integration with "git commit""
>
> I was planning to merge the series to 'next', but perhaps we should
> wait at least for the first two items (I do not think the third one
> is necessary to block the series).

I will send soon a new version of the series with more tests and fixes. It will also contains a patch that adds an empty line before the trailers in the output if there is not already one. After that I plan to work on adding examples to the documentation.

Show 22 quoted lines
>>> Why support both '=' and ':'?  Using just one would make it easier to
>>> grep through scripts to see who is adding signoffs.
>>
>> That was already discussed previously.
>
> I do recall it was discussed previously, but given that a new reader
> posed the same question, I am not sure if the end result in this
> patch under discussion sufficiently answers the question in a
> satisfactory way.
>
>> The reason is that people are used to "token=value" for command line
>> arguments, but trailers appears in the result as "token: value", so it
>> is better for the user if we support both.
>
> While I do understand the part before ", so" on the second line, I
> do not see why that leads to the conclusion at all.
>
> Yes, because it is a well-established convention to separate option
> name with its parameter with '=', accepting "--option=parameter"
> makes sense.  That may result in a string "Option: parameter" added
> to the output from the command.  I am not sure why that output has
> anything to do with how the command line should be specified.

First accepting both ':' and '=' means one can see the "git interpret-trailers" as acting on trailers only. Not just on trailers from the intput message and option parameters from the command line. But from trailers both from the input message and being passed as arguments. In my opinion it is good if it can be seen this way, as it may simplifies the user's mental model of how the command works.

And second there is also a practical advantage, as the user can copy-paste trailers directly from other messages into the command line to pass them as arguments to "git interpret-trailers" without the need to replace the ':' with '='. Even if this command is not often used directly by users, it might simplify scripts using it.

Third there is a technical advantage which is that the code that parses arguments from the command line can be the same as the code that parses trailers from the input message.

Thanks, Christian.

Previous: Junio C HamanoNext: Junio C Hamano
Message 20 of 24 in “Add interpret-trailers builtin”
  1. 00/11 Add interpret-trailers builtinChristian Couder, Apr 1, 2014
  2. 01/11 trailer: add data structures and basic functionsChristian Couder, Apr 1, 2014
  3. 02/11 trailer: process trailers from stdin and argumentsChristian Couder, Apr 1, 2014
  4. 03/11 trailer: read and process config informationChristian Couder, Apr 1, 2014
  5. 04/11 trailer: process command line trailer argumentsChristian Couder, Apr 1, 2014
  6. 05/11 trailer: parse trailers from stdinChristian Couder, Apr 1, 2014
  7. 06/11 trailer: put all the processing together and printChristian Couder, Apr 1, 2014
  8. 07/11 trailer: add interpret-trailers commandChristian Couder, Apr 1, 2014
  9. 08/11 trailer: add tests for "git interpret-trailers"Christian Couder, Apr 1, 2014
  10. Junio C HamanoApr 1, 2014
  11. Junio C HamanoApr 1, 2014
  12. Christian CouderApr 2, 2014
  13. 09/11 trailer: execute command from 'trailer.<name>.command'Christian Couder, Apr 1, 2014
  14. 10/11 trailer: add tests for commands in config fileChristian Couder, Apr 1, 2014
  15. 11/11 Documentation: add documentation for 'git interpret-trailers'Christian Couder, Apr 1, 2014
  16. Jonathan NiederApr 2, 2014
  17. Christian CouderApr 2, 2014
  18. Junio C HamanoApr 4, 2014
  19. Junio C HamanoApr 4, 2014
  20. Christian CouderApr 7, 2014
  21. Junio C HamanoApr 7, 2014
  22. Christian CouderApr 7, 2014
  23. Junio C HamanoApr 7, 2014
  24. Junio C HamanoApr 7, 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.