#!/bin/sh
#
# A cvs commitinfo script to reject commits of files that contain tabs.
#
# Expected to be invoked with the repository and a list of files. The
# repository is ignored.
#

while [ $# -gt 1 ] ; do
   # search for tabs; grep exits with 0 on a match, 1 for nomatch
   grep '	' $2
   if [ $? -eq 0 ]; then
      # got match, so fail
      exit 1
   fi
   shift
done

# no tabs found in any of the files, success
exit 0

##
## Suggested usage:
##
## On the repository, 'mkdir $CVSROOT/bin'
## Copy this file into $CVSROOT/bin/reject_tabs
## Check out the CVSROOT 'cd /tmp; cvs checkout CVSROOT'
## Add a line to the CVSROOT/commitinfo file, like
##    'DEFAULT /path/to/cvs/root/bin/reject_tabs'
## (but appropriate to where you put this script at).
##
