[asdf-devel] tab-blocking commit hook

Robert Goldman rpgoldman at sift.info
Thu Jan 14 16:30:34 UTC 2010


On 1/11/10 Jan 11 -9:43 PM, Stelian Ionescu wrote:
> On Wed, 2009-12-23 at 23:38 -0500, dherring at tentpost.com wrote:
>> The attached script should prevent tabs in *.asd, *.lisp, or *.script
>> files from being committed to a git repository.  Existing tabs will not be
>> affected, unless they appear in (the context of) another modification.
>> Here's an example stopped commit.
>> ""
>> Error: This git repository disallows the #\Tab character in lisp files.
>> Only spaces should be used for indenting lisp code.
>> In emacs, 'M-x untabify' and (setq indent-tabs-mode nil) may help.
>>
>> First offending file and lines:
>> test.asd
>> +	this is a tab
>> ""
> 
> I've attached a slightly modified version that also checks for spaces at
> the end of a line and only on added/modified lines, not in the context
> of the patch
> 
>>
>> To install, simply copy this script to .git/hooks/pre-commit and set the
>> executable bit.
>>
>> It might also be good to put a copy somewhere permanent so others can
>> install it to their local repositories.
> 
> good idea

Is there some reason that this cannot be pushed into the repository
itself (i.e., used like a blur/clean thing)?  See the bottom of this
page: http://progit.org/book/ch7-2.html

I.e., we just automagically detabify when staging.

It seems inappropriate to expect everyone to fuss with his/her own
repository to get this behavior.  Shouldn't we do it once on the shared
repo and we all get it for free?




More information about the asdf-devel mailing list