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

Re: [RFC/PATCH 0/2] place cherry pick line below commit title

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Oct 4, 2016, 00:08 UTC
Message-ID
<84f28caa-2e4b-1231-1a76-3b7e765c0b61@google.com>
In-Reply-To
<xmqq8tu55bel.fsf@gitster.mtv.corp.google.com>
On 10/03/2016 03:13 PM, Junio C Hamano wrote:
Show 15 quoted lines
> Jonathan Tan <jonathantanmy@google.com> writes:
>
>> There are other options like checking for indentation or checking for
>> balanced parentheses/brackets, but I think that these would lead to
>> surprising behavior for the user (this would mean that whitespace or
>> certain characters could turn a valid trailer into an invalid one or
>> vice versa, or change the behavior of trailer.ifexists, especially
>> "replace").
>
> Yes, that is exactly why I said that it may be necessary for the
> code to analize the lines in a block identified as "likely to be a
> trailing block" more carefully.  We can afford to be loose as long
> as the only allowed operation is to append one at the end, but once
> we start removing/replacing an existing entry, etc., the definition
> of what an entry is becomes very much relevant.

I agree, and I was trying to discuss the possible alternatives for the definition of what an entry is in my previous e-mail.

If you think that the alternatives are still too loose, I'm not sure if we can make it any tighter. As far as I know, we're dealing with trailers like the following:

   Signed-off-by: A <author@example.com>
   [This has nothing to do with the above line]
   Signed-off-by: B <buthor@example.com>
and:
   Link 1: a link
     a continuation of the above
and:
   Signed-off-by: Some body <some@body.xz> (comment
   on two lines)

As I stated in the quoted paragraph, one possibility is to use indentation and/or balanced parentheses/brackets to determine if a trailer line continues onto the next line, and this would handle all the above cases, but I still think that these would lead to surprising behavior. Hence my suggestion to just simply define it as a single physical line. But if you think that the pros (of the more complicated approach) outweigh the cons, I'm OK with that.

One alternative is to postpone this decision by changing sequencer only (and not trailer) to tolerate other lines in the trailer. This would make them even more divergent (sequencer supports arbitrary lines while trailer doesn't), but they were divergent already (sequencer supports "(cherry picked by" but trailer doesn't).

Previous: Junio C HamanoNext: Junio C Hamano
Message 14 of 20 in “place cherry pick line below commit title”
  1. 0/2 place cherry pick line below commit titleJonathan Tan, Sep 29, 2016
  2. 2/2 sequencer: allow origin line below commit titleJonathan Tan, Sep 29, 2016
  3. 1/2 sequencer: refactor message and origin appendingJonathan Tan, Sep 29, 2016
  4. Junio C HamanoSep 29, 2016
  5. Jonathan TanSep 30, 2016
  6. Junio C HamanoSep 30, 2016
  7. Jonathan TanSep 30, 2016
  8. Junio C HamanoOct 3, 2016
  9. Junio C HamanoSep 30, 2016
  10. Jonathan TanOct 3, 2016
  11. Junio C HamanoOct 3, 2016
  12. Jonathan TanOct 3, 2016
  13. Junio C HamanoOct 3, 2016
  14. Jonathan TanOct 4, 2016
  15. Junio C HamanoOct 4, 2016
  16. Junio C HamanoOct 4, 2016
  17. Jonathan TanOct 5, 2016
  18. Junio C HamanoOct 6, 2016
  19. Jonathan TanOct 5, 2016
  20. Junio C HamanoOct 5, 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.