On Sun, Feb 13, 2011 at 9:21 PM, jd <[email protected]> wrote:
> On Feb 13, 8:52 pm, Abhishek Shadangi <[email protected]> wrote:
>> That's because - git checkout will checkout the files from the git
>> database, and will use your CRLF settings native to you OS and modify the
>> files.
>
> Ok, so I turned off autocrlf and now 'git status' says that nothing
> has changed.
>
> I'm still somewhat puzzled.  I can see that with autocrlf turned on,
> some of my files
> might have undergone CRLF-ification.  But if so, shouldn't git
> recognize that the
> CRLFs were added (and would presumably be removed on commit)?
>
> Also, some of my files already had consistent usage of CRLF; why would
> those files
> be affected by autocrlf?
>
> Thanks for your continued help on this issue.  I'd like to gain a good
> enough
> understanding so that I don't shoot myself in the foot again ;-)

Basically git's autocrlf setting is buggy and always has been.  You
can sometimes munge it into working if you set it *before* checking
out of a repo, but if you set it on an already-checked-out repo, weird
things generally happen.

The git developers have put quite a bit of work into fixing it, but
unfortunately none of the core developers use Windows, thus none of
them have crlf problems.  The developers who *do* have crlf problems
learned to set the setting once and ignore it.  So the problems tend
not to get entirely fixed.

I did see some patches go by; maybe a newer version of git will fix
the problem though.

One common git crlf problem occurs when someone *not* using autocrlf
commits a file that contains crlf instead of lf line endings.  Then
when you checkout the file with autocrlf enabled, git gets confused.

The easiest thing to do is to just never use autocrlf mode; if all
your developers are on Windows anyway, you don't need to fix the crlf
problems anyhow.

Have fun,

Avery

-- 
You received this message because you are subscribed to the Google Groups 
"GitHub" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/github?hl=en.

Reply via email to