forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eirik Bjørsnøs <>
Subject Re: Please not hard-coded tabs in SVN
Date Sun, 15 Aug 2004 14:57:20 GMT

> Not to pick on you Thorsten, but your commits have been
> adding hard-coded tab markers into otherwise tab-free files.


Why not set up a pre-commit check script in SVN that scans all commited 
files for tabs and abort the commit if it finds any?

We've been doing this in a project I'm in (using CVS),  with great 
success.  I'm sure it's possible to implement something similar using 

Here's the perl script we're using:

# Scan all files
foreach $file (@ARGV) {
     if ($file =~ /.java/) {
         open(FILEHANDLE, $file);
         $line = 0;
         while (<FILEHANDLE>) {
             if (/\t/) {
                 print("Tab detected on line $line in file $file:\n$_");
                 print("Please remove it and try again\n");

Checking should be disabled for binary files, though.

Eirik Bjørsnøs

View raw message