Thread (27 messages) flat view 27 messages, 10 authors, 2016-08-13

Re: CRLF problems with Git on Win32

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:44:04

Possibly related (same subject, not in this thread)


On Thu, 10 Jan 2008, Gregory Jefferis wrote:
So this is what has to be accommodated.  But instead of having autocrlf
always set on Windows and always converting to LF in the repository, why not
do nothing by default [ .. ]
Why? You can screw yourself more, and much more easily (and much more 
subtly), by leaving CRLF alone on Windows.

The thing is, 99.9% of all people will be *much* better off with 
autocrlf=true on Windows than with it defaulting to off (or even fail).

Isn't *that* the whole point of having a default? Pick the thing that is 
the right thing for almost everybody?

And no, "but think of the children.." is not a valid argument. Sure, you 
*can* corrupt binary imags with CRLF conversion. But it's really quite 
hard, since the git heuristics for guessing are rather good. You really 
have to work at it, and if you do, you're pretty damn likely to know about 
the issue, so that 0.1% that really needs to not convert (and it's usually 
one specific file type!) would probably not even turn off CRLF, but rather 
add a .gitattributes entry for that one filetype!

(Side note: if there are known filetype extensions that have problems with 
the git guessing, we sure as heck could take the filename into account 
when guessing! There's absolutely nothing that says that we only have to 
look at the contents when guessing about the text/binary thing!)

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