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

Johannes Pfau johannespfau at googlemail.com
Tue Jan 25 03:21:14 PST 2011


Am Dienstag, den 25.01.2011, 01:13 -0800 schrieb Walter Bright:
> 
> Johannes Pfau wrote:
> >
> > The "core.autocrlf" section on http://progit.org/book/ch7-1.html says:
> >
> > "Git can handle this by auto-converting CRLF line endings into LF when
> > you commit, and vice versa when it checks out code onto your filesystem.
> > You can turn on this functionality with the core.autocrlf setting. If
> > you’re on a Windows machine, set it to true — this converts LF endings
> > into CRLF when you check out code"
> >
> > and
> >
> > "If you’re on a Linux or Mac system that uses LF line endings, then you
> > don’t want Git to automatically convert them when you check out files;
> > however, if a file with CRLF endings accidentally gets introduced, then
> > you may want Git to fix it. You can tell Git to convert CRLF to LF on
> > commit but not the other way around by setting core.autocrlf to input"
> >
> >   
> 
> Here's what happens - someone checks in CRLF files on Windows. Then I 
> check out the repository on Linux. Now, git status claims that these 
> files are "different" on Linux and need checking in again.
> 
> There really is no hope for this, other than ensuring that all source 
> files checked in are LF, nor CRLF, terminated.
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos

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.



More information about the phobos mailing list