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

From: Finn Arne Gangstad <[email-masked]>
Date: Sun, 9 May 2010 22:09:37 +0200

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