Each 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. The trigger action script analyzes the user's comment (passed in an environment variable), disallowing unacceptable ones (null or empty comments, for example).
NOTE: When ClearCase fires a trigger, it proceeds based on the success or failure of the trigger operation, as determined by the trigger script's exit code. A .bat file returns the exit code of its last command. Preoperation triggers are the only kind of trigger that cause the ClearCase execution to fail.
cleartool mktrtype -element -all -preop checkin ^
-c "must enter descriptive comment" -exec \\neon\scripts\comm_pol.bat CommentPolicy
@echo off
rem comm_pol.bat
rem
rem Check for null comment
rem
if "%CLEARCASE_COMMENT%"=="" copy > NUL:
Feedback on the documentation in this site? We welcome any comments!
Copyright © 2001 by Rational Software Corporation. All rights reserved. |