[cvsnt] Windows verifymsg example

Adrian Crossley adrian.crossley at hesa.ac.uk
Wed Oct 13 16:35:59 BST 2004


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


Example verifymsg as promised.

My php verifymsg script is called verifymsg.php as follows:
<?php
//read in msg file
$msg = file_get_contents($argv[1]);

//trim ws
$msg = trim($msg);

//check msg is of substance (two or more words and six or more chars is OK)
//Must try again if not
$words = explode(' ', $msg);
if ( (count($words) < 2) || (strlen(implode('', $words))<6) ) {
  echo "Please provide a more substantial commit message
than\n\"$msg\"\n\n";
  exit(1);
} else {
  exit(0);
}
?>

To enable it you will need to edit the file CVSROOT\verifymsg.  Mine is a
single line as follows:
DEFAULT php /cvsnt/cvsroot-it/CVSROOT/verifymsg.php

Note that because my script lives in CVSROOT you also need to add its
filename to CVSROOT\checkoutlist.

Test thoroughly as bugs in verifymsg.php will cause it to always fail (i.e.
always return a non-zero exit code) and you won't be able to commit anything
- including a corrected verifymsg.php!  If this happens delete the admin
file CVSROOT\verifymsg which will be recreated when you next commit to
CVSROOT.

hope this helps
Ade


______________________________________________________________

This outgoing email was virus scanned for HESA by MessageLabs.
______________________________________________________________


More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook