[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Interactive Hooks

From: David Weintraub <qazwart_at_gmail.com>
Date: Mon, 15 Jun 2009 11:15:44 -0400

As others have told you, it's not possible. The major issue is that the hook
runs completely on the server and the only communication to the client is
indicating a failure by the hook script doing an exit other than zero.

It can be frustrating. In ClearCase, you can interact with the hook script.
You can ask for information, request confirmation, and even change the file
being committed.

That may sound great, but it comes at a major price: In order to do this,
your hook script runs on each and every client.

Imagine you wrote a Python hook, but the client doesn't have Python on their
system. Or, you wrote a Python hook, but the client didn't have the correct
version of Python. Or, you have a developer that found they could get around
the hook by creating a "Python" batch program that merely did an "exit 0"?
(We actually had a few developers do this to get around hook scripts).

Now, you are responsible for the maintenance of all your client systems.
When someone at work gets a new PC. You not only have to install Subversion,
but you have to install and configure the whole system so your hook scripts
work. If you had 100 users, and the average PC lasted 3 years, you'd have to
configure 33 PCs each and every year. Even worse, many times users will
simply have their PCs wiped clean because of some other issue like a bad
virus infection. You could be spending most of your time simply installing
and maintaining client PCs.

Even worse, if someone wants access from home, you will have to have them
bring in their PC (or now, PCs since many people have multiple PCs at home).

Having the hook execute on the server simplifies a lot: Your hook script
only has to execute on a single machine. You don't have to worry about
client configurations. (You want to install Subversion on your PC? Here's
the link.) You lose some flexibility, but you gain a lot of stability and
frees you from a lot of responsibility.

What you really need to ask yourself is why do you need to ask a developer
if they are sure whether or not they want to commit or add a particular
file. Are developers modifying standard text based files and replacing them
with non-text files? Are developers submitting unicode files instead of pure
ascii files? What is your policy trying to prevent?

On Sun, Jun 14, 2009 at 7:46 AM, Tom Browder <tom.browder_at_gmail.com> wrote:

> I would like to have a pre-commit hook script that asks for
> confirmation when adding a new file that is a non-ascii file.
> Is that possible?
> Thanks.
> -Tom
> Tom Browder
> Niceville, Florida
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2361952
> To unsubscribe from this discussion, e-mail: [
> users-unsubscribe_at_subversion.tigris.org].

David Weintraub
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-06-15 17:16:41 CEST

This is an archived mail posted to the Subversion Users mailing list.