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

Re: [PATCH v2 0/4] handle multiline in-body headers

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 19, 2016, 21:39 UTC
Message-ID
<xmqqr38fd0y1.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<cover.1474319086.git.jonathantanmy@google.com>
Jonathan Tan <jonathantanmy@google.com> writes:
Show 13 quoted lines
> This is an iteration of the patch set after the discussion in
>  <cover.1474047135.git.jonathantanmy@google.com>.
>
> Changes:
> o largely rewritten to follow Junio's suggested design (refactor of
>   check_header to separate out ">From" and "[PATCH]", and an
>   is_inbody_header function performing an airtight check on whether a
>   line is an in-body header)
> o simpler try_convert_to_utf8 API
> o one file of the expected output of t/t5100/*0015 is modified (instead
>   of the input)
> o t/t5100/*0018--no-inbody-headers test files added
> o example in commit message improved following Peff's suggestion

Overall it looks much nicer, but I still do not understand why we want to do try-convert-to-utf8. The _only_ caller of that helper function is in 4/4 where it tries to convert the line to see if a line is a scissors line.

It seems to me that the only thing doing so gives us is that you could later enhance the definition of what a scissors-line looks like by adding unicode characters [*1*], but I would strongly suggest not doing that kind of enhancement [*2*]. With the current definition of what a scissors-line looks like, it can be checked before you do the UTF-8 conversion, I think, which would mean that the helper is not strictly necessary.

So...
[Footnotes]

*1* E.g. ✂ encoded in non-UTF8 may have to be converted to UTF-8 first before being recognized as such.

*2* Encouraging people to use non-ASCII that older version of Git did not take for structural things like "what is a scissors line" merely for the looks is a bad trade-off; patch e-mails that use the enhanced definition will break for those with older version of Git, and the benefit of "prettier scissors" is not really worth it, I would think.

Previous: Jonathan TanNext: Jonathan Tan
Message 6 of 12 in “handle multiline in-body headers”
  1. 0/4 handle multiline in-body headersJonathan Tan, Sep 19, 2016
  2. 1/4 mailinfo: separate in-body header processingJonathan Tan, Sep 19, 2016
  3. 3/4 mailinfo: make is_scissors_line take plain char *Jonathan Tan, Sep 19, 2016
  4. 2/4 mailinfo: refactor to support utf8 decode attemptsJonathan Tan, Sep 19, 2016
  5. 4/4 mailinfo: handle in-body header continuationsJonathan Tan, Sep 19, 2016
  6. Junio C HamanoSep 19, 2016
  7. 0/3 handle multiline in-body headersJonathan Tan, Sep 20, 2016
  8. 1/3 mailinfo: separate in-body header processingJonathan Tan, Sep 20, 2016
  9. 2/3 mailinfo: make is_scissors_line take plain char *Jonathan Tan, Sep 20, 2016
  10. 3/3 mailinfo: handle in-body header continuationsJonathan Tan, Sep 20, 2016
  11. Jeff KingSep 20, 2016
  12. Junio C HamanoSep 21, 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.