Re: About git reporting missing newline for symlinks

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

 



On 2022-10-12 at 21:17:04, Ignacio Taranto wrote:
> So, both git diff and git show display "\ No newline at end of file"
> for symlinks.
> 
> I think this is related to how Git renders diffs, IMO it shouldn't
> display a warning about
> newlines for symlinks.
> 
> Am I making any sense here?

What Git shows for a symlink is the destination of the symlink.  On
Unix systems other than macOS, path names may contain any byte other
than NUL, including a newline.

While it obviously is not a good practice to include newlines in your
paths, it is possible, and Git would not be able to round-trip symlinks
where the final character of the destination is a newline if we didn't
handle trailing newlines properly.  As a result, we're not likely to
change things here because it's required for correctness.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

Attachment: signature.asc
Description: PGP signature


[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