[dmd-internals] LF and CRLF on git

Leandro Lucarella luca at llucax.com.ar
Wed Jan 16 13:34:31 PST 2013


Walter Bright, el 15 de January a las 21:30 me escribiste:
> 
> On 1/15/2013 7:31 PM, Brad Roberts wrote:
> >Correct, and github has no mechanism for it either. So, I'm happy
> >to add this checking to the load balancer, but someone else build
> >the hook and play with it and get it working w/in their own
> >environment first . There's no reason it shouldn't be put in
> >developer repositories and catch the problem BEFORE they get
> >committed locally. The auto tester can be the second layer of
> >defense.
> 
> While you're adding the check for CRLF in the autotester, can you
> please also add a check to reject any .d files with tab characters?
> (Just for .d files. Don't want to do that for makefiles!)

While you're at it, you could also add some checks for other common
white space errors. The sample pre-commit hook that comes with each
repository have this check enabled, you just have to enable that hook by
renaming it from pre-commit.sample to just pre-commit. Then you have to
adjust the git config core.whitespace to whatever you want to check
(there are several options, see git config --help for details).
Unfortunately those checks don't include either the CRLF check or the
"all spaces" (there is an option to check the opposite, that only tab is
used for indentation), but it cover other common errors as trailing
white spaces.

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Algún día los libros desterrarán a la radio y el hombre descubrirá el
oculto poder del Amargo Serrano.
	-- Ricardo Vaporeso. El Bolsón, 1909.


More information about the dmd-internals mailing list