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

Re: CRLF problems with Git on Win32

From: Marius Storm-Olsen <hidden>
Date: 2016-06-15 22:44:03

Linus Torvalds said the following on 07.01.2008 23:58:

On Mon, 7 Jan 2008, Junio C Hamano wrote:
quoted
So wouldn't the categorization be more like this?
Well, one thng we could do is to add a new concept, namely

	core.autocrlf = warn

and make *that* the default.

It would do the check, but not actually convert anything, just warn about 
it.

Then, it's up to the user to set it explicitly to "true" or "false", 
unless they just like seeing that warning a million times ;)

That might be acceptable to most people.
I actually would want the default to be
     core.autocrlf = windows

Meaning, it would be true on Windows platforms, and warn on all 
others. That way it would work as expected in 90% of the time, namely 
that files are added to the repo with unix line endings. We could then 
add the following warning when you try to add a CRLF file on 
non-Windows platforms:

   * CRLF line endings detected for text files: <foo>, <bar>, <baz>
   Consider adding the following to a .gitattributes file to
   maintain the CRLF line endings on all platforms:
     <foo> = -crlf
     <bar> = -crlf
     <baz> = -crlf

Maybe then can we lure non-Windows users to add these required 
.gitattributes files for files that need to be CRLF on all platforms; 
instead of shoving the whole burden of maintaining a proper 
cross-platform repo onto the Windows users alone.

/me braces for the "it's your fault for working on Windows in the 
first place!" flood ;-)

Of course, setting the core.autocrlf = true|false should not show the 
warning, for users who don't care about repo portability to Windows 
anyways.

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