Subject: Re: CRLF problems with Git on Win32

From: Rogan Dawes <[email-masked]>
Date: Thu, 10 Jan 2008 22:50:56 +0200

Gregory Jefferis wrote:

> I'm not sure that I understand the whole deal about platform default line
> endings.  Isn't plain git functionally agnostic about line endings?  You can
> check in CRLF text files to git and it doesn't care.  You can diff, show etc
> just fine.  I haven't yet found anything that breaks with CRLF files.  In
> this sense plain git is already Windows ready.  Maybe I'm missing something?
> 
> Doesn't the problem only come if you try to diff a CRLF file with a new
> version that has LF only line endings?  Then right now you have to use
> something like:
> 
>     git diff --ignore-space-at-eol
> 

> In conclusion all of these CRLF options are designed to help Windows users
> play nicely with others.  But it seems to me naïve Windows users can be
> perfectly happy with plain git so long as they stay in their own Windows
> world.
> 
> jm2c, corrections welcome and apologies to those suffering from eol
> exhaustion,
> 
> Greg.

One example that bit me recently was "git-apply --whitespace=strip"

I have files with CRLF in my repo, but git was stripping the CR from 
lines that I applied via a patch.

I worked around it with a smudge/clean filter of "dos2unix | unix2dos" 
(first removes all CR's, second puts one back on each line)

Rogan