[cvsnt] commitinfo not passing arguments to the specified scr ipt.

Tony Hoyle tmh at nodomain.org
Fri Aug 1 11:24:14 BST 2003


mike.porter at bt.com wrote:

> I'm trying to implement the pre-commit checking from commitinfo using the
> STDIN to determine the list of filenames as suggested (thanks). Im still
> having problems however. 
> 
> My commitinfo is calling the following perl script which undefs the eol CRLF
> and then prints the STDIN. What I find is that the STDIN is empty (see
> commit trace below below). Ive also tried 'while' looping around the STDIN
> but again don't see anything on the STDIN.
> 
The code I use is:

# parse command line arguments
#
while (@ARGV) {
     $arg = shift @ARGV;

     if ($arg eq '-d') {
	$debug = 1;
	print STDERR "Debug turned on...\n";
     } elsif ... <argument processing stuff>
     } else {
	push(@files, $arg);
     }
}

$directory = shift @files; # Module/directory is first arg

# For new-style commitinfo, read stdin for list of files
while (<STDIN>) {
   chop;			# Drop the newline
   push(@files, $_);
}

This works OK for me...  I've tried to make it backward compatible (so 
it parses the files off both the command line and the standard input)... 
not that I've ever tried it on an older version :)

Tony




More information about the cvsnt mailing list