99.1 trigger examples.

JeffA.Bowlesjab@pobox.com JeffA.Bowlesjab at pobox.com
Thu Mar 18 09:29:36 PST 1999


A week or so ago, I wrote a handful of examples of "pre-submit triggers"
that use the new 99.1 mechanism. They're mainly teaching examples,
so you can see some of the things you might want to do (or to avoid)
when you're writing a trigger.

They've been put onto the Perforce "public depot", which is accessible
using a Perforce client and also in a readonly capacity from the Web.
If you go to the following URL, you'll see those trigger examples:
    http://public.perforce.com/public/perforce/utils/index.html#triggers
(There's also a link at the top of that page to more information about
the "public depot". It's a handy thing to learn about!)

All the examples are in Perl at the moment; I'll add a couple of ".cmd"
scripts (NT command shell) and Python as things go along. If you
write a trigger that proves useful to you, please consider forwarding
it for inclusion in the public depot - it might help others and get you
good feedback on your script(s).

For the curious, the four current examples are:
Jobs.pl		Example trigger to enforce a rule "submissions
		must be associated with a job". 
CheckC.pl	A script to notice when you're creating new
		files (or integrating to a new branch) and the
		directory name you're writing the [new] file to
		isn't the same case as an existing directory name.
		(For example, if "//depot/x/y/z.c" exists, this won't
		allow you to create a file named "//depot/X/Y/one.c".) 
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...."

So there it is. I'll be updating the FAQ list (probably under "admin FAQs")
in the next day or so to include trigger questions, also.

- ---------------------
Jeff Bowles
Perforce Consulting Partner
http://public.perforce.com/guest/jeff_bowles/jab.html





More information about the perforce-user mailing list