[phobos] [dmd-internals] svn-->git migration

Walter Bright walter at digitalmars.com
Tue Jan 25 10:46:19 PST 2011



Johannes Pfau wrote:
>
> If the person on windows has set core.autocrlf = true this will ensure
> that the checked in files are LF terminated. With core.autocrlf = true
> CRLF files cannot enter the repository, but it's important that every
> windows user sets core.autocrlf to true.
>
> If the person on windows hasn't set that variable the CRLF files will
> enter the repository. If someone on linux with core.autocrlf = input
> checks out those files they will be fixed to LF endings automatically -
> which imho is a good thing. Because of that the files will be shown as
> changed(They now have different line endings as in the repository. This
> is a change and needs to be commited). If you don't want git to fix that
> automatically just use core.autocrlf = false on linux.
>
>
>   

Thanks for the explanation and the tip. But that requires everyone who 
clones the depository to do this. It should work correctly with a 
default git install.

Another problem - meld on linux shows every line as different between 
CRLF and LF files, and there is no option to ignore line ending 
differences. Working badly with differing line endings is typical for 
linux programs. (Though to be fair, Windows Notepad can't deal with LF 
files.)

This is just like the tab situation. Are tabs 3, 4 or 8 characters? 
There is no solution - the only way is to not use tabs. The most 
reasonable way forward with git is to never check in CRLF files. I've 
added detab and tolf to my workflow, and I ask everyone else to who 
edits files on Windows as well.


More information about the phobos mailing list