Pre-Submit Trigger Examples

From Perforce Workshop
Jump to: navigation, search

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.

Script Name Description Example trigger to enforce a rule "submissions must be associated with a job.". 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. Example trigger to enforce a rule "files of suffix .x/.y need to be checked in as pairs". 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.