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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Vincent

On 02/12/2022 17:01, Vincent Lefevre wrote:
Hi Phillip,

On 2022-12-02 16:41:23 +0000, Phillip Wood wrote:
On 02/12/2022 14:11, Vincent Lefevre wrote:
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.

First, one issue is that this is not documented (I was not aware of
the notion of trailers, well, at least concerning a special handling
by Git).

They are mentioned in the documentation for 'git commit' see the --signoff and --trailer options. The main reference is 'git interpret-trailers'

Then perhaps there should be some configuration to define which
tokens are allowed (or forbidden) for trailers. For instance,
I would say that "Note" is too common in log messages to be
regarded as a trailer token.

There are some safeguards when looking for trailers (see the interpret-trailers man page) I think you have been unlucky here, I don't remember this being reported before. I've cc'd Christian who knows more about trailers than I do to see if he has anything to add.

Best Wishes

Phillip



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux