Re: [PATCH/RFC v2 1/4] Add "core.eolStyle" variable to control end-of-line conversion
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:48:46
On Sun, 9 May 2010, Eyvind Bernhardsen wrote:
I'm sorry. Are you the same Linus Torvalds who wrote this:quoted
Btw, since we're discussing this, I do think that our current "crlf=input" syntax for .gitattributes is pretty dubious.
Yes, it's dubious. But as with the kernel, we need to support backwards
compatibility for things that have reasonably been used (and "input" has).
I really brought it up as an example of things that weren't necessarily
all that well designed.
That said, it looks like people actually do want per-file line-ending
settings, ie not just a global "I want CRLF vs LF". So it looks like
crlf=input is actually useful in a .gitattributes files, if only because
some people seem to want to mix CRLF and just LF in the same repository.
It also sounds like people actually want to have the reverse (ie not just
"input", but have a mode where LF may be the default, but then some
particular files must always be CRLF even if most files are normal text).
So I suspect we want to really have support for all four combinations
_both_ in the .git/config file, _and_ in the .gitattributes file.
The four cases would be "none" ("binary" or "-crlf"), "lf" ("input" or
"crlf=input"), "system default", and "force crlf".
Honestly, I would personally have preferred to have just a repo-wide "this
is the line ending". Not some path-specific endings like "crlf=input" in
the .gitattributes. But people do seem to want it.
Linus