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/validate-cvs-log.sh

  5. Create /usr/local/bin/validate-cvs-log.sh script (make it executable for all cvs users):
  6. #!/bin/sh
    #
    # validate-cvs-log.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
    else
    exit 0
    fi

  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.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
0 Comments
Khadas VIM4 SBC