Subject: Re: CRLF problems with Git on Win32

From: Gregory Jefferis <[email-masked]>
Date: Thu, 10 Jan 2008 21:28:15 +0000

On 10/1/08 20:20, "Linus Torvalds" <[email-masked]> wrote:

>  - Mixed windows usage - either with other UNIX users, or even just
>    *within* a windows environment if *some* of the tools are basically
>    UNIX ports (ie MinGW or Cygwin without text-mounts)
> 
>    In this case, some tools will write files with CRLF, and others will
>    write them with LF. Again, usually all tools can *read* either form,
>    but the writing is mixed and depends on the tool (so if you work in a
>    group where different people use different editors, you will literally
>    switch back-and-forth between LF and CRLF, sometimes mixing the two in
>    the same file!).
> 
>    This one - at the very least - basically requires "autocrlf=input".
>    Anything else is just madness, because otherwise you'll get files that
>    get partly or entirely rewritten in the object database just due to
>    line ending changes.

So this is what has to be accommodated.  But instead of having autocrlf
always set on Windows and always converting to LF in the repository, why not
do nothing by default unless the repository contains some information
specifying that it wants some or all text files to have a particular kind of
line ending (e.g. in gitattributes).  Then the choice of line ending inside
the repository is up to the people creating/maintaining the repo, which just
seems right.  

Insisting that repos created on windows should have textfiles munged to LF
by default doesn't seem right.  Even using Dmitry's clever autocrlf=safe
option on Windows would lead to inconvenience since all LF files have to be
explicitly attributed as text.  We should be helping Windows people to use
LF files rather than hindering them!