Subject: Re: git diff, git mergetool and CRLF conversion

From: Charles Bailey <[email-masked]>
Date: Wed, 21 Jan 2009 17:23:51 +0000

On Wed, Jan 21, 2009 at 06:55:34PM +0200, Hannu Koivisto wrote:
> Hi,
> 
> Suppose I have core.autocrlf set to true and and due to that a
> version controlled file in a working tree with CRLF line endings.
> If I modify such a file and then say "git diff", I get a patch with
> LF line endings.
> 
> Also, if get a merge conflict with a file to which CRLF conversion
> is applied and run e.g. "git mergetool -t emerge", the temporary
> files representing stage2 and stage3 versions seem to have LF line
> endings.
> 
> Is this intended behaviour?  I'm using 1.6.1 on Cygwin.

Speaking for mergetool, I believe that it's simply because mergetool
uses git cat-file which just outputs the raw contents of a blob and
doesn't do any line ending conversion.

IMHO, I think that it should probably perform the 'convert to working
tree format' change when preparing the temporary files. I'm not sure
how best to do that, but perhaps it should be using git checkout-index
with the --temp option instead of cat-file.

-- 
Charles Bailey
http://ccgi.hashpling.plus.com/blog/