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

Re: [PATCH 04/11] doc: trailer: explain "commit mesage part" on first usage

From
LALinus Arver <linusa@google.com>
Date
May 10, 2023, 06:44 UTC
Message-ID
<owlymt2cn0rm.fsf@fine.c.googlers.com>
In-Reply-To
<xmqqa5yeobrj.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
> "Linus Arver via GitGitGadget" <gitgitgadget@gmail.com> writes:
>> From: Linus Arver <linusa@google.com>
>> This phrase is used for the first time here, but it's not explained what
>> it means. So explain it just in case it's not obvious.
> 03+04 should be a single patch
Agreed.
> otherwise it would
> waste reviewer's time (just like I did thinking and writing about
> 03/11).

Thank you for the pointer. I will be more careful about patch order moving forward.

Show 6 quoted lines
> Or just drop "part".  "git cat-file commit HEAD | sed -e '1,/^$/d'"
> is a good material to use with "--no-divider" because it only has
> the "commit message".  The "part" implies you first had something
> that has both "commit message" and something else and you split
> that combination into two (or more) parts.  But that does not have
> to be the case.  I think that made 03/11 confusing, at least to me.

Looking back, I don't think I had a good grasp of what "commit message part" meant. When I wrote this series I thought "commit message part" meant everything in the output of git-format-patch until hitting the "---" divider. But as you point out in your

     git cat-file commit HEAD | sed -e '1,/^$/d'

example, technically there is never any ambiguity of what the commit message contains (it only contains a commit message, not a "commit message part" and a separate "patch part"). And the output of git-format-patch is a patch (which contains the commit message and also other things), not a commit message with different subparts. I was operating under this flawed understanding, oops.

That being said, there are several instances in the DESCRIPTION section when we use the "commit message part" phrasing (as opposed to just "commit message"). I am leaning toward just dropping "part" as you suggested. Also, I think we should add an explanation of how git-interpret-trailers sees the incoming text, how it gives special treatment to a "---" divider line, how it uses this line to mark off a commit message part (and then uses this part as the default location of adding trailers, unless specifying a "--no-divider" flag), etc. This could be in a revamped 03+04 patch, or perhaps left out until another day. I'll see what I can do in v2.

>> Signed-off-by: Linus Arver <linusa@google.com>
>> ---
>>   Documentation/git-interpret-trailers.txt | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
Show 9 quoted lines
>> diff --git a/Documentation/git-interpret-trailers.txt  
>> b/Documentation/git-interpret-trailers.txt
>> index 3e60a6eaabc..7d6e250f37e 100644
>> --- a/Documentation/git-interpret-trailers.txt
>> +++ b/Documentation/git-interpret-trailers.txt
>> @@ -22,9 +22,9 @@ This command reads some patches or commit messages  
>> from either the
>>   <file> arguments or the standard input if no <file> is specified. If
>>   `--parse` is specified, the output consists of the parsed trailers.
Show 9 quoted lines
>> -Otherwise, this command applies the arguments passed using the
>> -`--trailer` option, if any, to the commit message part of each input
>> -file. The result is emitted on the standard output.
>> +Otherwise, this command applies the arguments passed using the  
>> `--trailer`
>> +option, if any, to the commit message part of each input file (as  
>> opposed to the
>> +patch part following a '---' divider). The result is emitted to  
>> standard output.
>>   Some configuration variables control the way the `--trailer` arguments
>>   are applied to each commit message and the way any existing trailer in
Previous: Junio C HamanoNext: Linus Arver via GitGitGadget
Message 13 of 73 in “docs: interpret-trailers: reword and add examples”
  1. 00/11 docs: interpret-trailers: reword and add examplesLinus Arver via GitGitGadget, May 8, 2023
  2. 01/11 doc: trailer: fix grammarLinus Arver via GitGitGadget, May 8, 2023
  3. Junio C HamanoMay 8, 2023
  4. Linus ArverMay 8, 2023
  5. Junio C HamanoMay 8, 2023
  6. 02/11 doc: trailer: swap verb orderLinus Arver via GitGitGadget, May 8, 2023
  7. Junio C HamanoMay 8, 2023
  8. 03/11 doc: trailer: --no-divider: more precise languageLinus Arver via GitGitGadget, May 8, 2023
  9. Junio C HamanoMay 8, 2023
  10. 05/11 doc: trailer: remove redundant phrasingLinus Arver via GitGitGadget, May 8, 2023
  11. 04/11 doc: trailer: explain "commit mesage part" on first usageLinus Arver via GitGitGadget, May 8, 2023
  12. Junio C HamanoMay 8, 2023
  13. Linus ArverMay 10, 2023
  14. 07/11 doc: trailer: use angle brackets for <token> and <value>Linus Arver via GitGitGadget, May 8, 2023
  15. Junio C HamanoMay 8, 2023
  16. 06/11 doc: trailer: trailer.<token>.cmd: add missing verb phraseLinus Arver via GitGitGadget, May 8, 2023
  17. Junio C HamanoMay 8, 2023
  18. Linus ArverMay 10, 2023
  19. Junio C HamanoMay 10, 2023
  20. 08/11 doc: trailer.<token>.command: refer to existing exampleLinus Arver via GitGitGadget, May 8, 2023
  21. Junio C HamanoMay 8, 2023
  22. Linus ArverMay 10, 2023
  23. Junio C HamanoMay 10, 2023
  24. 09/11 doc: trailer.<token>.command: emphasize deprecationLinus Arver via GitGitGadget, May 8, 2023
  25. Junio C HamanoMay 8, 2023
  26. Linus ArverMay 10, 2023
  27. 10/11 doc: trailer: mention 'key' in DESCRIPTIONLinus Arver via GitGitGadget, May 8, 2023
  28. 11/11 doc: trailer: add more examples in DESCRIPTIONLinus Arver via GitGitGadget, May 8, 2023
  29. Junio C HamanoMay 8, 2023
  30. Junio C HamanoMay 8, 2023
  31. Linus ArverMay 8, 2023
  32. 0/9 docs: interpret-trailers: reword and add examplesLinus Arver via GitGitGadget, May 11, 2023
  33. 1/9 doc: trailer: fix grammarLinus Arver via GitGitGadget, May 11, 2023
  34. 2/9 doc: trailer: swap verb orderLinus Arver via GitGitGadget, May 11, 2023
  35. 3/9 doc: trailer: drop "commit message part" phrasingLinus Arver via GitGitGadget, May 11, 2023
  36. 5/9 doc: trailer: remove redundant phrasingLinus Arver via GitGitGadget, May 11, 2023
  37. 6/9 doc: trailer: use angle brackets for <token> and <value>Linus Arver via GitGitGadget, May 11, 2023
  38. 4/9 doc: trailer: examples: avoid the word "message" by itselfLinus Arver via GitGitGadget, May 11, 2023
  39. 9/9 doc: trailer: add more examples in DESCRIPTIONLinus Arver via GitGitGadget, May 11, 2023
  40. 7/9 doc: trailer.<token>.command: emphasize deprecationLinus Arver via GitGitGadget, May 11, 2023
  41. 8/9 doc: trailer: mention 'key' in DESCRIPTIONLinus Arver via GitGitGadget, May 11, 2023
  42. Junio C HamanoMay 12, 2023
  43. Linus ArverMay 16, 2023
  44. Junio C HamanoMay 16, 2023
  45. 0/9 docs: interpret-trailers: reword and add examplesLinus Arver via GitGitGadget, Jun 6, 2023
  46. 1/9 doc: trailer: fix grammarLinus Arver via GitGitGadget, Jun 6, 2023
  47. 2/9 doc: trailer: swap verb orderLinus Arver via GitGitGadget, Jun 6, 2023
  48. 3/9 doc: trailer: drop "commit message part" phrasingLinus Arver via GitGitGadget, Jun 6, 2023
  49. Christian CouderJun 14, 2023
  50. Linus ArverJun 15, 2023
  51. 4/9 doc: trailer: examples: avoid the word "message" by itselfLinus Arver via GitGitGadget, Jun 6, 2023
  52. Christian CouderJun 14, 2023
  53. Linus ArverJun 15, 2023
  54. 5/9 doc: trailer: remove redundant phrasingLinus Arver via GitGitGadget, Jun 6, 2023
  55. 6/9 doc: trailer: use angle brackets for <token> and <value>Linus Arver via GitGitGadget, Jun 6, 2023
  56. 7/9 doc: trailer.<token>.command: emphasize deprecationLinus Arver via GitGitGadget, Jun 6, 2023
  57. 8/9 doc: trailer: mention 'key' in DESCRIPTIONLinus Arver via GitGitGadget, Jun 6, 2023
  58. Christian CouderJun 14, 2023
  59. Linus ArverJun 15, 2023
  60. 9/9 doc: trailer: add more examples in DESCRIPTIONLinus Arver via GitGitGadget, Jun 6, 2023
  61. Christian CouderJun 14, 2023
  62. Linus ArverJun 15, 2023
  63. Christian CouderJun 15, 2023
  64. 0/9 docs: interpret-trailers: reword and add examplesLinus Arver via GitGitGadget, Jun 15, 2023
  65. 1/9 doc: trailer: fix grammarLinus Arver via GitGitGadget, Jun 15, 2023
  66. 2/9 doc: trailer: swap verb orderLinus Arver via GitGitGadget, Jun 15, 2023
  67. 3/9 doc: trailer: drop "commit message part" phrasingLinus Arver via GitGitGadget, Jun 15, 2023
  68. 5/9 doc: trailer: remove redundant phrasingLinus Arver via GitGitGadget, Jun 15, 2023
  69. 4/9 doc: trailer: examples: avoid the word "message" by itselfLinus Arver via GitGitGadget, Jun 15, 2023
  70. 6/9 doc: trailer: use angle brackets for <token> and <value>Linus Arver via GitGitGadget, Jun 15, 2023
  71. 7/9 doc: trailer.<token>.command: emphasize deprecationLinus Arver via GitGitGadget, Jun 15, 2023
  72. 8/9 doc: trailer: mention 'key' in DESCRIPTIONLinus Arver via GitGitGadget, Jun 15, 2023
  73. 9/9 doc: trailer: add more examples in DESCRIPTIONLinus Arver via GitGitGadget, Jun 15, 2023

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.