[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with writing scripts
From: |
Michael Santos |
Subject: |
Re: Help with writing scripts |
Date: |
Sun, 7 Oct 2001 11:15:50 -0400 |
User-agent: |
Mutt/1.2.5i |
On Sun, Oct 07, 2001 at 03:49:31PM +0200, Roni Abusch wrote:
> It's my first time using CVS, and I do not exactly know how to write scripts
> for it. For example, some simple scripts I need: one that checkout the last
> version automatically, or one that force the users to enter comment. I tried
> to use the manual examples, but it didn't work.
> Can someone please help me?
> Thanks,
> Roni.
Hi Roni,
Here's how I enforce placing comments on commits.
Use the attached script and add the path to the script in
$CVSROOT/CVSROOT/verifymsg:
DEFAULT <path>/<to>/logcheck
I'm using virtual users and allowing empty comments on commits by all
users mapped to "cvsadmin".
Good luck,
--
Michael Santos
address@hidden
logcheck:
=cut
#!/usr/bin/perl -w
# MIST Inc.
# $Id: logcheck.pl,v 1.10 2001/07/13 02:09:22 msantCVS Exp $
#
# Enforce log messages upon commit.
#
#----------------------------------------------------------------------
# 27/06/01
#
# Should be used with rcsinfo to provide a template for users.
# Currently just exits if the log is empty.
#----------------------------------------------------------------------
use strict;
exit 0 if ( $ENV{'USER'} =~ /^cvsadmin$/ );
eval {
while (<>) {
die unless (/^(\s*|no message)$/ );
}
};
unless ($@) {
print "*******************************************\n";
print " COMMIT DENIED: Log messages are mandatory.\n\n";
print " Please retry your commit and when\n";
print " prompted, provide a description\n";
print " of the changes you have made.\n";
print "*******************************************\n";
exit 1;
}
=cut