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: Finn Arne Gangstad <hidden>
Date: 2016-06-15 22:48:46

On Sun, May 09, 2010 at 12:42:17PM +0200, Eyvind Bernhardsen wrote:
I guess I should nail my flag to the mast: Here's what I would have
done, with the benefit of plenty of hindsight, had we not had
core.autocrlf, and also what I think we should do to approach that
ideal.
[...]
After some meditation, I think the following:

The most important thing is how we can fix git on Windows to operate
well by default. This is what we really should try to fix.

The way git on Windows would work best, while at the same time cause
the minimum amount of damage, would IMHO be:

- Convert LF-only text files to CRLF on checkout
- Convert those same files (but only those!) back to LF on commit
- Optionally: Convert new CRLF text files to LF on commit

And all this should happen without setting any configuration, and not
setting any attributes.

So maybe, just maybe, we can make everything sufficiently good by
repairing "core.autocrlf = {input,true}" so that git will not convert
a CRLF already in the repo. This would make autocrlf = true a safe
default value (and probably input too, but you'd have to "do
something" to get a new text file with CRLF into the repo then).

Then we go from a situation that didn't work, to a working situation,
and break nothing that used to work. You no longer have to normalise
your repos to work from Windows.

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