0

Are local pre-commit hooks a function of TortoiseSVN only? It seems that the svn command line client does not support them. If the answer is yes, is there any way to script their installation? My situation is that there are a lot of committers, two or three hundred maybe.

We have several release managers who each have multiple VMs with multiple branches checked out on each VM. I'd like to have a script we can lay down and run on each VM instead of manually adding (through the tortoise GUI) one hook per release manager per VM per working copy. Adding it server-side would result in a lot of unnecessary work and slowdown for the server. We are all on windows. Thank you!

4
  • What sort of hook are you looking for, and why isn't it appropriate for the server? Commented Feb 25, 2015 at 5:55
  • @Ben We have lots of developers and few release managers. The release managers sometimes break XML files during merges so I want to verify our XML files aren't broken after a merge using a pre-commit hook. Forcing everybody to do this verification through a server-side hook would be unnecessarily time consuming. Commented Feb 25, 2015 at 13:18
  • Do developers commit to the same branch as release managers? If not, you could set up the hook script to only take effect if the commit is happening on the release branch. Or, you could set up the hook script to only take effect if mergeinfo has changed (indicating a merge happened). This may be more resistant to mistakes than requiring a certain client configuration. Commented Feb 25, 2015 at 16:18
  • @Ben Good ideas but they all commit to the same branches and RMs frequently commit mergeinfo separately from code. Commented Feb 25, 2015 at 16:31

1 Answer 1

1

Yes, client-side hooks are a TortoiseSVN-only feature (the settings shown here are global to the user's TortoiseSVN client). You can configure them for for specific projects via the tsvn:*hookscript properties.

For distribution, you may want to keep the hook scripts on a centralized file share and reference them via UNC path in those properties. That way, everyone should be pointed to the same hook scripts all the time. You'll need to ensure that your hooks do not depend upon specific paths either for working copies or other tools that your scripts might be dependent upon.

However, you should not become completely dependent upon client-side hook scripts. You can't control which client(s) a user may use and if they don't use TortoiseSVN, that functionality won't exist.

Sign up to request clarification or add additional context in comments.

1 Comment

Also, local hooks can be changed by the local user. We had that problem with ClearCase where users would get around a hook by simply writing their own.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.