Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:52

Yann Droneaud [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help