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

Re: [PATCH v4 5/8] trailer: clarify failure modes in parse_trailer

From
Christian Couder <christian.couder@gmail.com>
Date
Oct 22, 2016, 13:07 UTC
Message-ID
<CAP8UFD0XvNx6Brio9muDhOj5+dr=HRbhK_Lmr+k4LUPKrAVC9Q@mail.gmail.com>
In-Reply-To
<xmqqeg3aeeqe.fsf@gitster.mtv.corp.google.com>
On Fri, Oct 21, 2016 at 2:18 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 32 quoted lines
> Jonathan Tan <jonathantanmy@google.com> writes:
>
>> That is true - I think we can take the allowed separators as an
>> argument (meaning that we can have different behavior for file parsing
>> and command line parsing), and since we already have that string, we
>> can use strcspn. I'll try this out in the next reroll.
>
> Sounds good.  Thanks.
>
>
> The following is a tangent that I think this topic should ignore,
> but we may want to revisit it sometime later.
>
> I think the design of the "separator" mechanism is one of the things
> we botched in the current system.  If I recall correctly, this was
> introduced to allow people write "Bug# 538" in the trailer section
> and get it recognised as a valid trailer.
>
> When I say that this was a botched design, I do not mean to say that
> we should have instead forced projects to adopt "Bug: 538" format.
> The design is botched because the users' wish to allow "Bug# 538" or
> "Bug #538" by setting separators to ":#" from the built-in ":" does
> not mean that they would want "Signed-off-by# me <my@addre.ss>" to
> be accepted.
>
> If I were guiding a topic that introduce this feature from scratch
> today, I would probably suggest a pattern based approach, e.g.  a
> built-in "[-A-Za-z0-9]+:" [*1*] may be the default prefix that is
> used to recognize the beginning of a trailer, and a user or a
> project that wants "Bug #538" would be allowed to add an additional
> pattern, e.g. "Bug *#", that recognises a custom trailer line that
> is used by the project.
When we designed the separator mechanism, we had the following discussions:

https://public-inbox.org/git/xmqqa9a1d6xn.fsf@gitster.dls.corp.google.com/ https://public-inbox.org/git/xmqqmwcuzyqx.fsf@gitster.dls.corp.google.com/

They made me think that you were against too much flexibility, so I removed functionality that allowed to put separators into the ".key" config options, and now you are saying that we botched the thing and that you would like more flexibility of this kind back.

Anyway I think it is still possible to add back such kind of functionality in a backward compatible way for example by adding ".extendedKey" config options.

Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 19 in “allow non-trailers and multiple-line trailers”
  1. 0/8 allow non-trailers and multiple-line trailersJonathan Tan, Oct 20, 2016
  2. 1/8 trailer: improve const correctnessJonathan Tan, Oct 20, 2016
  3. 2/8 trailer: use list.h for doubly-linked listJonathan Tan, Oct 20, 2016
  4. 6/8 trailer: allow non-trailers in trailer blockJonathan Tan, Oct 20, 2016
  5. 5/8 trailer: clarify failure modes in parse_trailerJonathan Tan, Oct 20, 2016
  6. Stefan BellerOct 20, 2016
  7. Junio C HamanoOct 20, 2016
  8. Jonathan TanOct 20, 2016
  9. Junio C HamanoOct 20, 2016
  10. Jonathan TanOct 20, 2016
  11. Junio C HamanoOct 21, 2016
  12. Christian CouderOct 22, 2016
  13. Junio C HamanoOct 22, 2016
  14. Christian CouderOct 22, 2016
  15. Jonathan TanOct 20, 2016
  16. 8/8 trailer: support values folded to multiple linesJonathan Tan, Oct 20, 2016
  17. 4/8 trailer: make args have their own structJonathan Tan, Oct 20, 2016
  18. 7/8 trailer: forbid leading whitespace in trailersJonathan Tan, Oct 20, 2016
  19. 3/8 trailer: streamline trailer item create and addJonathan Tan, Oct 20, 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.