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

Re: [PATCH v2] trailer: allow spaces in tokens

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Aug 18, 2022, 17:56 UTC
Message-ID
<20220818175600.3531267-1-jonathantanmy@google.com>
In-Reply-To
<xmqqk075qyq0.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 32 quoted lines
> "Max Bernstein via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
> > Range-diff vs v1:
> >
> >  1:  404a6d1b193 ! 1:  4d490851ac2 trailer: allow spaces in tokens
> >      @@ Commit message
> >       
> >           Signed-off-by: Max Bernstein <max@bernsteinbear.com>
> >       
> >      + ## t/t4014-format-patch.sh ##
> >      +@@ t/t4014-format-patch.sh: test_expect_success 'signoff: not really a signoff' '
> >      + 	4:Subject: [PATCH] subject
> >      + 	8:
> >      + 	9:I want to mention about Signed-off-by: here.
> >      +-	10:
> >      +-	11:Signed-off-by: C O Mitter <committer@example.com>
> >      ++	10:Signed-off-by: C O Mitter <committer@example.com>
> >      + 	EOF
> >      + 	test_cmp expect actual
> >      + '
> 
> So, the updated code mistook the body of the message that is not a
> sign-off, because there is a colon on the line, the line does not
> begin with the colon, and everything before the colon is an alnum or
> a whitespace, so squashed the paragraph break before the real
> trailer block and the last line of the body and made it a body-less
> commit log message?
> 
> This might be a good demonstration of why it is a mistaken design to
> allow whitespaces, which may steer us toward fixing the documentation?
> 
> I dunno.  What do others think?

Yeah, this was the same issue we discussed a few years ago [1]. "git commit -s" has never supported spaces before the colon (at least, it did not support it before my patch set in [1] and does not support it now) so it seems that having no spaces is already the established convention, and I think that interpret-trailers should follow it. I would agree that we should fix the documentation to match the current behavior.

[1] https://lore.kernel.org/git/a416ab9b-ff1f-9a71-3e58-60fd4f8a6b8e@google.com/
Previous: Junio C HamanoNext: Maxwell Bernstein
Message 4 of 19 in “trailer: allow spaces in tokens”
  1. trailer: allow spaces in tokensMax Bernstein via GitGitGadget, Aug 18, 2022
  2. trailer: allow spaces in tokensMax Bernstein via GitGitGadget, Aug 18, 2022
  3. Junio C HamanoAug 18, 2022
  4. Jonathan TanAug 18, 2022
  5. Maxwell BernsteinAug 18, 2022
  6. Christian CouderAug 18, 2022
  7. Junio C HamanoAug 18, 2022
  8. Junio C HamanoAug 19, 2022
  9. Christian CouderAug 19, 2022
  10. Johannes SchindelinAug 22, 2022
  11. Documentation: clarify whitespace rules for trailersChristian Couder, Aug 23, 2022
  12. Junio C HamanoAug 24, 2022
  13. Christian CouderAug 25, 2022
  14. Junio C HamanoAug 25, 2022
  15. Documentation: clarify whitespace rules for trailersChristian Couder, Aug 30, 2022
  16. Junio C HamanoAug 30, 2022
  17. Junio C HamanoAug 18, 2022
  18. Jonathan TanAug 18, 2022
  19. Junio C HamanoAug 18, 2022

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.