Re: git interpret-trailers: behavior with input without trailing newline

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

 



On Thu, Jul 08, 2021 at 10:33:46AM +0000, Luca Weiss wrote:

> I'm investigating a behavior with git interpret-trailers where when
> the input does not end with a newline, git appends the trailer
> directly without a newline; and on running the same command again it
> doesn't detect the previous trailer anymore.
> 
> I've whipped up a quick PoC in form of a new test case in the existing
> test cases of git.

In general, I think commit message inputs should have trailing newlines,
as they'd generally be coming from actual commits, or piped through
git-stripspace to clean things up.

That said, the behavior you're seeing does seem like a bug to me. I
don't think it was intended, and it would be nice to fix it, if you're
up for it. It might be as simple as conditionally adding a newline after
we read the input in trailers.c:read_input_file(). (IMHO even if we do
not end up adding a trailer, normalizing the whitespace in this way
would be a fine behavior for the command).

-Peff



[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