Re: git diff returns fatal error with core.safecrlf is set to true.

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

 



Yann Droneaud <ydroneaud@xxxxxxxxxx> writes:

> While testing the behavor of Git regarding CRLF handling,
> when core.safecrlf is set to true, I've found that "git diff" is
> returning
> "fatal: CRLF would be replaced by LF" without returning any kind of
> diff.
>
> This make me wonder if its the correct behavor for git diff to (only)
> fail:
> It should be fatal for git add / git commit ( / git cherry-pick /
> ... ?),
> but non fatal for git diff.

Yeah, I agree.

This is a diff between something and the working tree file, right?
It needs to convert from the working tree representation to the
canonical repository representation before doing the actual
comparison, and most likely the same helper function that is reused
for the check-in codepath, which needs to error out, is erroring out
after finding an input in your working tree that cannot safely
round-trip between LF/CRLF world.

The helper may want to learn a way to be told to demote that error
to a warning.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]