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

From: Yann Droneaud <hidden>
Date: 2016-06-15 22:57:52

Hi,

Following my previous email "Tracking vendor release with Git" [1][2],
and the advice from Git users/developers, I'm trying to use 
.gitattributes
to handle CRLF/LF conversion.

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.

According to the documentation git-config(5) [3]:
"Git will verify if a command modifies a file in the work tree either 
directly or indirectly"
I don't thing "git diff" is an operation that could modify a file.

Regards.

1. [ref]
2. <http://thread.gmane.org/gmane.comp.version-control.git/227466>
    <http://marc.info/?l=git&m=137097069115462&w=2>
3. https://www.kernel.org/pub/software/scm/git/docs/git-config.html

-- 
Yann Droneaud
OPTEYA
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help