[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: add hook question (was Re: Problem with importing third-party source

From: Paul Sander
Subject: Re: add hook question (was Re: Problem with importing third-party sources and adding/committing changes)
Date: Wed, 17 Nov 2004 08:23:47 -0800

>--- Forwarded mail from address@hidden

>Paul Sander wrote:

>> Keep in mind that, although Greg does not acknowledge it, a number
>> of people in this forum have stated a requirement for an add-time
>> trigger that could be used for such things as enforcement of naming
>> conventions and access control.  Such a feature (referred to in the
>> past as "addinfo") would reinstate the need to contact the server
>> during additions.

>I would personally be loathe to make any feature that doesn't require
>a connection require one if it could be helped. In fact, I've actually
>been thinking about disconnecting some of the other functionality,
>such as cvs diff against the base version of a file.  Perhaps if the
>connection failed and then the work was simply done locally, it would
>be acceptable.

It's fair to say that the client shouldn't gratuitously contact the server.
On the other hand, I think it's safe to say that several of us in this
forum disagree over what is gratuitous.  I happen to think that triggers
should run on the server, and therefore any triggerable event should
contact the server.

>Why is an add hook considered to be an improvement over the hook that
>runs at commit time?

It's true that add and commit hooks can enforce the same kinds of policies
as post-conditions of the commit.  However, add hooks can enforce things
like naming conventions.  I'm working in a shop right now that prefers to
have additions to the source tree (particularly new directories) be made
by the architects of the project rather than the rank and file, and such a
policy is best enforced at add time.

The reason why I say these are best done at add time is because if the
add succeeds then the user is likely to do a lot more work under the
assumption that the subsequent commit will succeed (or at least not fail
due to conditions created by the add).  If the commit fails due to an
improper add, then the user must re-do (or un-do) a bunch of work.  All
those hours of lost productivity could have been avoided by an add-time

The counter-argument is that CVS is not a project management tool, and
that if the conditions I describe above come to be then it must a problem
in that area.  But keep in mind that hooks exist to enforce policies set
by project management.  If you want to blame violations of policy on bad
management, then you might as well remove all hooks.  If you want
mechanized policy enforcement using hooks, then do it right, in all the
places where it's needed.  And I contend that add time is one place where
it's needed.

>--- End of forwarded message from address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]