[p4] Trigger to automatically change content when submitted

Paul Goffin Paul.Goffin at aepnetworks.com
Mon May 15 23:13:16 PDT 2006


I agree with most of what David wrote, but have this comment:

>The best solution is a trigger that checks the files before being
>submitted for the condition you want, and rejects the submission if that
>condition isn't met. For example, let's say you state that the word
>"copyright" (small "c") must be in the first four lines of all text

I don't think it's ever a good idea to reject submissions to the depot.

If you start putting barriers in front of your developers so that the process of "Doing Things The Right Way" becomes increasingly difficult, they will look for (and find) easier ways of doing things.  (They're generally clever people, after all.)

Soon, your source repository will not actually contain the source of the product you're actually shipping.

(In this particular case, with a customer screaming for a vital fix for his product, what senior manager will demand the release is held up for an extra week while the product is retested because the source code had to be changed after code freeze because someone forgot to change the copyright message in a couple of files?  No, they'll support short-cutting the system.)

IMHO, the "right" way to do this is to implement a "Nagging" process.   Review the code _after_ sumbission and send out emails to the submitter and the codeline owner.

Paul




More information about the perforce-user mailing list