Block CVS Commits without message

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.

  1. Checkout the CVSROOT directory
  2. cvs co CVSROOT

  3. Edit verifymsg in CVSROOT as follows
  4. #Set the verifymsg file to run a script
    DEFAULT /usr/local/bin/

  5. Create /usr/local/bin/ script (make it executable for all cvs users):
  6. #!/bin/sh
    # logfile

    # test that log message has some characters in it
    if [ cat $1 | wc -c -lt 12 ] ; then
    echo “log message too short; please enter a description for the changes”
    exit 1
    exit 0

  7. Commit verifymsg
  8. 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.

Support CNX Software - Donate via PayPal, become a Patron on Patreon, or buy review samples
Notify of