Re: CRLF problems with Git on Win32
- From
- Marius Storm-Olsen <mstormo-re5jqeeqqe8avxtiumwx3w@public.gmane.org>
- Date
- Jan 8, 2008, 08:55 UTC
- Message-ID
- <47833A66.9080007@gmail.com>
- In-Reply-To
- <alpine.LFD.1.00.0801071457040.3148-5CScLwifNT1QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Linus Torvalds said the following on 07.01.2008 23:58:
Show 18 quoted lines
> > > On Mon, 7 Jan 2008, Junio C Hamano wrote: >> So wouldn't the categorization be more like this? > > Well, one thng we could do is to add a new concept, namely > > core.autocrlf = warn > > and make *that* the default. > > It would do the check, but not actually convert anything, just warn about > it. > > Then, it's up to the user to set it explicitly to "true" or "false", > unless they just like seeing that warning a million times ;) > > That might be acceptable to most people.
I actually would want the default to be
core.autocrlf = windowsMeaning, it would be true on Windows platforms, and warn on all others. That way it would work as expected in 90% of the time, namely that files are added to the repo with unix line endings. We could then add the following warning when you try to add a CRLF file on non-Windows platforms:
* CRLF line endings detected for text files: <foo>, <bar>, <baz>
Consider adding the following to a .gitattributes file to
maintain the CRLF line endings on all platforms:
<foo> = -crlf
<bar> = -crlf
<baz> = -crlfMaybe then can we lure non-Windows users to add these required .gitattributes files for files that need to be CRLF on all platforms; instead of shoving the whole burden of maintaining a proper cross-platform repo onto the Windows users alone.
/me braces for the "it's your fault for working on Windows in the first place!" flood ;-)
Of course, setting the core.autocrlf = true|false should not show the warning, for users who don't care about repo portability to Windows anyways.
-- .marius