Thread (32 messages) flat view 32 messages, 7 authors, 2016-06-15

Re: [PATCH/RFC v2 1/4] Add "core.eolStyle" variable to control end-of-line conversion

From: Eyvind Bernhardsen <hidden>
Date: 2016-06-15 22:48:46

On 9. mai 2010, at 20.11, Linus Torvalds wrote:
On Sun, 9 May 2010, Eyvind Bernhardsen wrote:
quoted
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).
Oh, absolutely.  I'm not suggesting removing support for it, I just don't think it's a good reason to keep the old naming alive.
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).
My plan was to "support" that by disabling conversion for those files; git wouldn't enforce the line endings, but at least it wouldn't break them.

I guess there's no reason not to have the option to enforce in there if there is a huge demand for that.
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".
Well, "crlf=crlf" and "crlf=lf" would look silly, but no more than I could live with.  .gitconfig is already covered in my series.
-- 
Eyvind
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help