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

Re: git cherry-pick -x: missing blank line before the "cherry picked from commit" line

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Dec 2, 2022, 16:41 UTC
Message-ID
<75e00d43-3184-dcf8-4621-cdf02c9f7320@dunelm.org.uk>
In-Reply-To
<20221202141153.GA5599@cventin.lip.ens-lyon.fr>
Hi Vincent
On 02/12/2022 14:11, Vincent Lefevre wrote:
Show 13 quoted lines
> With git 2.38.1 under Debian, when I use "git cherry-pick -x"
> on a commit such that the last line of the log message starts
> with "note:" (case insensitively), the blank line before the
> "cherry picked from commit" line is missing.
> 
> For instance:
> 
>      New commit
>      
>      foo
>      
>      nOtE:
>      (cherry picked from commit 3ba643e2eec4bdc1cd46b478ab36ee0707d241c2)

"git cherry-pick -x" takes care not to add a blank line if there are trailers such as Signed-off-by: at the end of the message (if it did then the trailers would no longer be recognized as trailers as they would not be the last paragraph). In this case the "nOtE:" line looks like a trailer and so no blank line is added.

I can see it is annoying in this case but I'm afraid I don't have any ideas of how we could avoid it without breaking the case where the message does contain trailers.

Best Wishes
Phillip
Show 38 quoted lines
> and
> 
>      New commit
>      
>      Note: foo.
>      (cherry picked from commit d0e85cdd32e30f78eeb968f275fc3a98899d791e)
> 
> but the following ones are OK:
> 
>      New commit
>      
>      note:
>      foo
>      
>      (cherry picked from commit a0ffae22fd3c94210170a3addcf802804f6ee5f7)
> 
> ----
> 
>      New commit
>      
>      A Note:
>      
>      (cherry picked from commit 0a89e0e7f8be3063803b0ad4381cd848ec52dd39)
> 
> ----
> 
>      New commit
>      
>      Note
>      
>      (cherry picked from commit f217bd5069c9d66a8ca54c869919ff484a18d20c)
> 
> ----
> 
> I also had reported the bug in the Debian BTS:
> 
>    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1025155
> 
Previous: Vincent LefevreNext: Vincent Lefevre
Message 2 of 7 in “git cherry-pick -x: missing blank line before the "cherry picked from commit" line”
  1. Vincent LefevreDec 2, 2022
  2. Phillip WoodDec 2, 2022
  3. Vincent LefevreDec 2, 2022
  4. Phillip WoodDec 4, 2022
  5. Vincent LefevreDec 4, 2022
  6. Christian CouderDec 5, 2022
  7. Vincent LefevreDec 16, 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.