Good documentation of changes is required

Each DevOps Code ClearCase® command that modifies a VOB creates one or more event records. Many such commands (for example, checkin) prompt for a comment. The event record includes the user name, date, comment, host, and description of what was changed.

To prevent developers from subverting the system by providing empty comments, you can create a preoperation trigger to monitor the checkin command.

Product Note: When a trigger is fired on a Windows® system, a DevOps Code ClearCase function proceeds based on the success or failure of the trigger operation, as determined by the trigger script exit code. A .bat file returns the exit code of its last command. Preoperation triggers are the only kind of trigger that causes the DevOps Code ClearCase operation to fail.

Trigger definition on Linux and the UNIX system

cleartool mktrtype –element –all –preop checkin \
–c "must enter descriptive comment" \
–exec /public/scripts/comment_policy.sh CommentPolicy 

Trigger definition on the Windows system

cleartool mktrtype –element –all –preop checkin ^
–c "must enter descriptive comment" ^
–exec \\neon\scripts\comm_pol.bat CommentPolicy 

Trigger action script on Linux and the UNIX system

#!/bin/sh
#
#   comment_policy
#
ACCEPT=0
REJECT=1
WORDCOUNT=‘echo $CLEARCASE_COMMENT | wc -w‘

if [ $WORDCOUNT -ge 10 ] ; then
   exit $ACCEPT
else
   exit $REJECT
fi

Trigger action script on the Windows system

@echo off
rem comm_pol.bat
rem 
rem Check for null comment
rem
if "%CLEARCASE_COMMENT%"=="" copy > NUL:

The trigger action script analyzes the user comment (passed in an environment variable), and disallows unacceptable ones.