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

Re: [PATCH 2/4] builtin/interpret-trailers: suppress blank line

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 7, 2016, 17:21 UTC
Message-ID
<xmqqegah1gis.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqqmvp51hhm.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 19 quoted lines
> "Michael S. Tsirkin" <mst@redhat.com> writes:
>
>> it's sometimes useful to be able to pass output message of
>> git-mailinfo through git-interpret-trailers,
>> but that creates problems since that does not
>> include the subject and an empty line after that,
>> making interpret-trailers add an empty line.
>>
>> Add a flag to bypass adding the blank line.
>
> I think I understand what you are trying to do, but using output
> that comes from 'mailinfo' alone as the input to anything (including
> interpret-trailers) does not make much sense.
>
> If you use the mailinfo output in the way it is expected to be used,
> i.e. take the subject from the "info" that goes to its standard
> output and append the "msg" with a blank between them, and feed the
> result to interpret-trailers, do you still need this step in your
> series?

OK, after reading 3/4 and guessing that you hand "msg" to interpret-trailers to let it munge its contents, it makes sense to allow us to tell interpret-trailers that you are feeding only the body of the message without the title and the blank line before it.

"suppress blank line" is a terrible title for that new feature, though. Perhaps "--body-only"?

The difference in behaviour in two modes (i.e. with title and without title) is that when the input does not have any blank line in it, the normal mode considers that there is no body (i.e. only title exists in the input) hence there is no existing trailer lines, and new trailer lines need to be added after adding blank, while the new "body only" mode considers that there is only one paragraph in the body, hence it may be the existing trailer block without any message (in which case that is the block new trailer lines are to be added to or existing ones to be removed from), or there is no trailer block but one paragraph of the message (in which case you would do the "add blank and append new trailer lines" thing).

I wrote the above down, hoping that it would give you a hint to better explain what this patch aims to do, so please feel free to further rephrase (or steal outright from) it when you reroll the series.

Thanks.
Previous: Junio C HamanoNext: Michael S. Tsirkin
Message 13 of 23 in “git-am: use trailers to add extra signatures”
  1. 0/4 git-am: use trailers to add extra signaturesMichael S. Tsirkin, Apr 7, 2016
  2. 1/4 builtin/interpret-trailers.c: allow -tMichael S. Tsirkin, Apr 7, 2016
  3. Junio C HamanoApr 7, 2016
  4. Matthieu MoyApr 7, 2016
  5. Junio C HamanoApr 7, 2016
  6. Michael S. TsirkinApr 7, 2016
  7. Michael S. TsirkinApr 7, 2016
  8. Junio C HamanoApr 7, 2016
  9. Michael S. TsirkinApr 7, 2016
  10. Junio C HamanoApr 7, 2016
  11. 2/4 builtin/interpret-trailers: suppress blank lineMichael S. Tsirkin, Apr 7, 2016
  12. Junio C HamanoApr 7, 2016
  13. Junio C HamanoApr 7, 2016
  14. Michael S. TsirkinApr 7, 2016
  15. Junio C HamanoApr 7, 2016
  16. Michael S. TsirkinApr 10, 2016
  17. Matthieu MoyApr 7, 2016
  18. 3/4 builtin/am: read mailinfo from fileMichael S. Tsirkin, Apr 7, 2016
  19. Junio C HamanoApr 7, 2016
  20. Michael S. TsirkinApr 7, 2016
  21. Matthieu MoyApr 7, 2016
  22. 4/4 builtin/am: passthrough -t and --trailer flagsMichael S. Tsirkin, Apr 7, 2016
  23. Christian CouderApr 7, 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.