This is described in the Cederqvist manual, but in a nutshell, you have to run a commit-time script that examines the comments for minimum content.  Doing it with a template ensures some consistency in the comments.  Basically,

1) verifymsg the standard cvs file runs on commit, and executes the script pontis.bugid.verify

... fragment of verifymsg applicable to project pontis (^pontis)

        # Allen R. Marshall, CS - 2004-03-18 - use symlink for repository...
        ^pontis /repository1/CVSROOT/support/pontis.bugid.verify
... end        

You can execute different scripts for different modules, or for all modules, I guess, which I don't do.

and

2) the contents of pontis.bugid.verify, which for project pontis, forces a formatted log message starting with the fixed format words  Bug ID:

This script requres bug id in specific fixed format PON-XXX, meaning we have a legitimate bugtracker ID in the message, viz:

Bug ID: PON-333
blah-blah-blah
blah-blah-blah

or

the word none as in

Bug ID: none
blah-blah-blah
blah-blah-blah

 are:

#!/bin/sh
#
#       pontis.bugid.verify filename
#
#  Verify that the log message contains a valid bugid
#  on the first line.
#
# PONTIS SPECIFIC
# PONTIS SPECIFIC
# PONTIS SPECIFIC
# Change History
##################################################################################
# Allen R. Marshall, CS - 2003-12-29 - initiated
# Allen R. Marshall, CS - 2004-01-06 - updated to require formatted string
#                                      and changed help comment
# Allen R. Marshall, CS - 2004-01-07 - updated help text for bad messages.
# Allen R. Marshall, CS - 2004-01-21 - allowed 1-3 digits of bug ID
#  e.g. PON-1 is OK, PON-02 is OK, PON-002 is OK
##################################################################################
# 3 digits 009
if sed 1q < $1 | grep '^Bug\ ID:\ [ ]*PON-[0-9][0-9][0-9]*$' > /dev/null; then
   exit 0

# 2 digits 09
elif sed 1q < $1 | grep '^Bug\ ID:\ [ ]*PON-[0-9][0-9]*$' > /dev/null; then
   exit 0

# 1 digit 9
elif sed 1q < $1 | grep '^Bug\ ID:\ [ ]*PON-[0-9]*$' > /dev/null; then
   exit 0

elif sed 1q < $1 | grep '^Bug\ ID:\ [ ]*none$' > /dev/null; then
   # It is okay to allow commits with 'Bug ID: none',
   # but do not put that text into the real log message.
# ARM - 2004-01-21 - let the message go in. All logging was getting suppressed
#    grep -v '^Bug\ ID:\ [ ]*none$' > $1.rewrite
#    mv $1.rewrite $1
   exit 0
else
   echo "Commit message rejected - bad format,"
   echo "No valid Pontis Bug ID was found on the first line of the message!"
   echo "========================================================================= "
   echo "Format example:"
   echo "Bug ID: PON-422 "
   echo "or"
   echo "Bug ID: none"
   echo "and, additional useful, illuminating commit message text
   echo "must follow....
   echo "========================================================================= "
   echo "Although you can enter > none < for the bug id, we implore you to "
   echo "please try to reference a specific Pontis bug in "
   echo "JIRA bugtracker format e.g.Bug ID:PON-nnn or PON-422"
   echo "whenever checking in a change in response to a known bug or "
   echo "enhancement request."
   echo "You can also embed any number of bug IDs in your commit text"
   echo "like - This fix addresses the issues with bugs PON-422, PON-423, PON-52"
   echo "blah blah blah blah..."
   echo "========================================================================= "
   echo "Last updated: 01/07/2004 by ARM"
   echo "========================================================================= "
   exit 1
fi



Allen Marshall
Cambridge Systematics, Inc.
100 CambridgePark Drive, Suite 400
Cambridge, MA 02140
tel  617 354 0167
fax  617 354 1542
e-mail  [EMAIL PROTECTED]
www.camsys.com
_______________________________________________
Info-cvs mailing list
Info-cvs@nongnu.org
http://lists.nongnu.org/mailman/listinfo/info-cvs

Reply via email to