[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

pre-commit hook: disallow-tabs (with attachment - doh!)

From: Scott Lawrence <slawrence_at_pingtel.com>
Date: 2004-06-02 03:39:21 CEST

I've attached a script that I hope will be useful to others who
constantly find indentation and whitespace-only differences because some
editors use tabs and others don't.

This script is designed to be invoked from your pre-commit hook script
as follows:
 
REPOS="$1"
TXN="$2"

DisallowCommit=0

#... other tests ...
 
# Check for tab characters in source files
if ! disallow-tabs "$REPOS" "$TXN" c cpp h html java
then
    # disallow-tabs prints error itself
    DisallowCommit=1
fi
 
exit $DisallowCommit
======================================

usage:
  disallow-tabs <repository> <transaction> <suffix>...

Specify a set of file suffixes (as written, they must be preceded by
'.', but that would be easy to change); files matching any suffix are
searched and the commit rejected if any tab characters are found.

(I've also posted this as a patch to the developers list for inclusion
in the distribution if you think it worthwhile).

-- 
Scott Lawrence
Consulting Engineer
Pingtel Corp.   
sip:slawrence@pingtel.com
+1.781.938.5306 x162


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Received on Wed Jun 2 03:39:50 2004

This is an archived mail posted to the Subversion Users mailing list.