On Mar 3, 2008, at 4:58 PM, Johannes Schindelin wrote:

Hi,

On Mon, 3 Mar 2008, Peter Harris wrote:

On Sun, Mar 2, 2008 Johannes Schindelin wrote:

 On Sun, 2 Mar 2008, Steffen Prohaska wrote:

On Mar 2, 2008, at 10:30 PM, Peter Harris wrote:

On Sat, Mar 1, 2008 Steffen Prohaska <[EMAIL PROTECTED]> wrote:

 core.autocrlf=true as its default.

After some digging, it turns out that "vi" in msysgit.git is a shell script, and git was trying to launch "sh\r" instead of "sh", since the
vi script was autocrlf'd.

You should force the msysgit repository to core.autocrlf = false

While I agree that MinGW itself (and thus the scripts that come with Git)
 should be LF-only

In that case, shouldn't there be a .gitattributes files with "* - crlf"
in 4msysgit (and the .gitattributes file already in msysgit modified
to say * instead of msys.bat and cmd/*.cmd)?

Thanks!  I completely forgot about crlf in .gitattributes.  I like it.

Steffen, do you agree?

In principle yes.  However, .gitattributes might not work
properly when switching branches if the file .gitattributes
itself changes.  Because of this, I try to avoid .gitattributes
as much as possible.

The only way that always works for me is to set core.autocrlf
before the first checkout.  I stopped using clone but instead always
"clone" manually, that is

   mkdir x
   cd x
   git init
   git config core.autocrlf <you-choice-here>
   git remote add origin <URL>
   git fetch origin
   git checkout ...

This sequence reliably works.  Any other procedure, including
.gitattributes sometimes lead to unexpected results for me.

But after everyone has the right .gitattributes in his work tree
and the .gitattributes do not change, everything should work.  So
I think we should tweak .gitattributes as proposed.

                Steffen

Reply via email to