[dmd-internals] LF and CRLF on git

Walter Bright walter at digitalmars.com
Tue Jan 15 13:47:33 PST 2013


I have had a bunch of trouble lately with git, which I suspect was the result of 
checking in a new file that had CRLF line endings instead of LF. I know that git 
is supposed to be able to deal with this, but my experience suggests it has a 
schizophrenic behavior regarding this.

My git checkin procedure is done with a script that prefaces it with:

tolf filename
detab filename

tolf ensures that the line endings are LF, and detab converts tabs to spaces. 
This canonicalizes all entries into git, and avoids all the ugly problems with CRLF.

Please ensure that you add these to your checkin workflow, or something 
equivalent. No, the .git settings are not sufficient.

(BTW, if someone wrote a D source code formatter, I'd love to add that to our 
checkin process!)


More information about the dmd-internals mailing list