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

Re: issue #137

From: Simon Large <simon_at_skirridsystems.co.uk>
Date: 2006-09-04 01:36:16 CEST

Stefan Küng wrote:
> I think the best (and only?) option is to go with global hook scripts
> specified in the settings dialog. Specifying the hook scripts via
> properties just doesn't seem to work in a reliable way.

Sorry for the late input. I just got back from holiday. How about this one:

The property contains a hook reference which has to be set up on the
client machine using the settings dialog. This would be a 2-column table
which contains the reference and the path to the actual hook.

The local table might look like this:
Reference Path on client machine
----------------------------------------------------------
myproject-pre-commit C:\path\to\wc\hooks\pre-commit.bat
yourproj-post-commit C:\path\to\yours\post-commit.bat
tsvn-pre-commit-gxf56-h75dt-2s9j7-23g7d C:\path\to\tsvn\hooks\pre-commit.bat

The last example includes some sort of GUID-like thingy to avoid name
collisions with hooks from other projects. As a later refinement you
might want to consider some way of helping the user to create
(hopefully) unique references. The GUID could of course be the
repository GUID.

The property would then simply contain:
tsvn:pre-commit-hook=myproject-pre-commit

When the client encounters such a property reference it looks in its
table. If there is a match it executes the script (according to local
client hook security options of course). If there is no match, you get a
warning and options:
a) Add a hook script reference
b) Ignore hook this time
c) Ignore hook always
d) Cancel whatever it is you are doing

Use option a) if you already have the script and know where it is. Use
option b) if you need to check up but want to carry on for now without
executing the script. c) adds a reference to your table but with an
empty path - next time the table will yield a match, but there is no hook.

This method has the advantage that the property can be applied recursively.

Security is also a little better with this method because the client
user has to make the link manually. The link could of course be to a
versioned script (the most likely scenario), and then there is the risk
that an evil committer changes the hook script at a later stage to do
something bad. No way round that one, unless you record script
timestamps in the table and warn if the script has been changed.

Simon

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Mon Sep 4 01:35:46 2006

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.