Re: CRLF problems with Git on Win32
- From
- J. Bruce Fields <bfields@fieldses.org>
- Date
- Jan 8, 2008, 19:09 UTC
- Message-ID
- <20080108190952.GK22155@fieldses.org>
- In-Reply-To
- <02DC77F5-7465-418D-972E-0F76E56C3F75@zib.de>
On Tue, Jan 08, 2008 at 07:58:57PM +0100, Steffen Prohaska wrote:
Show 22 quoted lines
> > On Jan 8, 2008, at 7:07 PM, Junio C Hamano wrote: > >> >> >> Steffen Prohaska <prohaska-wjoc1KHpMeg@public.gmane.org> writes: >> >>> msysgit installs plain git. core.autocrlf is unset. Whatever plain >>> git's default is, this is msysgit's default, too. >> >> That sounds like a mistake if you are installing a port to a >> platform whose native line ending convention is different from >> where plain git natively runs on (i.e. UNIX). > > We failed to agree on a better default and as the lengthy > discussion documents, the best default isn't obvious. > > I don't think a solution will be found by declaring one platform > native (UNIX) and all other platform non-native. The question to > answer is how to support cross-platform projects. A valid > solution should never corrupt data unless the user explicitly > told git to do so.
My only suggestion is that we consider allowing the user that "explicitly told git to do so" be the project maintainer. So if you
echo * autodetectcrlf >.gitattributes git add .gitattributes git commit
then users that clone your repo will get that default without having to be told to do something magic on clone.
(And ideally I'd've hoped you could do that using the existing crlf attribute rather than having to invent something new, but maybe that doesn't work.)
--b.
Show 9 quoted lines
> I don't believe it is a valid solution to set > core.autocrlf=true on Windows and tell the users: "Well, in its > default settings, git sometimes corrupts your data on Windows. > Maybe you want to switch to Linux because this is the native > platform where data corruption will never happen." > > I'd prefer the "warn/fail" proposal. > > Steffen