Thread (1 message) 1 message, 1 author, 2017-11-21

Re: core.safecrlf warning is confusing[improvement suggestion?]

From: Junio C Hamano <hidden>
Date: 2017-11-21 05:44:11

Vladimir Nikishkin [off-list ref] writes:
So I put the source in the working directory and tell git to make

git diff --stat

and I see the (ambiguous) warnings:

'warning: LF will be replaced by CRLF in filename.m.
The file will have its original line endings in you working directory.'

How I read them: "even though you have core.autocrlf=true, LF will be
replaced by CRLF and the repository will store CRLF files. However,
after you checkout them again, the CRLFs will be converted back to
LF(because the files will have original line endings in the working
directory.)"

 I feel like it's the opposite of what is actually happening.

So, would it make sense to change the warning message to? :

'warning: When you next checkout this commit, your code will have CRLF
line endings. However, right now your files will not be altered.'
I actually think "git diff" should not be triggering the warning
message.  The message may be appropriate when you are doing "git
add", at which point the "will be replaced and that may not be what
you want to see" warning might apply, but "diff" is doing a read-only
thing and will not be replacing anything with any other thing.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help