Pre-Submit Trigger Examples
Example Perforce pre-submit triggers
The following scripts were written and contributed by Jeff Bowles and Wes Peters. These scripts are all "submit"-type triggers and were written prior to the introduction of other trigger types, such as form triggers. More recent and varied trigger examples can be found in the Perforce System Administrator's Guide.
|Jobs.pl||Example trigger to enforce a rule "submissions must be associated with a job.".|
|Jobs.sh||Similar to above, but contributed by Wes Peters and written in Unix "shell". Takes a different approach to the problem, running "p4 fixes" to determine whether you're fixing something with this submission.|
|Pairs.pl||Example trigger to enforce a rule "files of suffix .x/.y need to be checked in as pairs".|
|Binary.pl||Example trigger to enforce a rule "submissions of .gif must binary files and .sh files should be text and...."|
|simple.cmd||Classroom example of writing a trigger using the Windows/NT command shell, a.k.a. "a .cmd script". (It checks that "Bug:" is included in the change description.) Doesn't do a lot, but gets the idea across.|