git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* core.safecrlf warning is confusing[improvement suggestion?]
@ 2017-11-21  5:18 Vladimir Nikishkin
  2017-11-21  5:44 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Vladimir Nikishkin @ 2017-11-21  5:18 UTC (permalink / raw)
  To: git

Hello, everyone.

I have the following question.

So I have a fresh git repository after git init, on Windows.

core.autocrlf is true explicitly, and core.safecrlf is true implicitly.

I want to have LF line endings in the repository and CRLF endings in
the working copy. (Because I use windows-exclusive tools to develop.)

But for start I have my code with LF endings, because I got it from a
fellow developer, who develops on UNIX, with LF line endings.

What I expect git to do:
Commit files as is (LF), keep my files in the working directory with
LF, but after issuing 'git checkout master' have them converted to
CRLF (since this is a checkout procedure).

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.'

-- 
Yours sincerely, Vladimir Nikishkin

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-11-22 14:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-21  5:18 core.safecrlf warning is confusing[improvement suggestion?] Vladimir Nikishkin
2017-11-21  5:44 ` Junio C Hamano
2017-11-21  5:49 ` Junio C Hamano
2017-11-21 16:18 ` Torsten Bögershausen
2017-11-22  2:01   ` Junio C Hamano
2017-11-22 14:56     ` Torsten Bögershausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).