If you are in my case, and you found it difficult to make some people in your team make proper comments/messages or any comments at all (cvs commit -m “Description of the changes”) while committing their changes to CVS, here’s what can be done to block commit without comments and with short comments.
- Checkout the CVSROOT directory
- Edit verifymsg in CVSROOT as follows
- Create /usr/local/bin/validate-cvs-log.sh script (make it executable for all cvs users):
- Commit verifymsg
cvs co CVSROOT
#Set the verifymsg file to run a script
# validate-cvs-log.sh logfile
# test that log message has some characters in it
cat $1 | wc -c-lt 12 ] ; then
echo “log message too short; please enter a description for the changes”
cvs commit -m “Added script to set minimum message size to 12 characters” verifymsg
That’s it ! Next time a developer tries to commit changes without messages/comments it will be declined.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.