I have a subversion installation with one repository per project and would like to add a few commit hooks that should apply for all the repositories. Is there any way to add a hook for all repositories? Especially in such a way that when I add a new repository these hooks also apply automatically? I can only find ways to do this on a per-repository basis.
Asked
Active
Viewed 732 times
1 Answers
5
Hooks can only be set up per repository. I usually have a folder where hooks are stored and use a batch file with a loop to copy them to the repositories.
To do this easily create a folder templates
in the SvnParentPath (the root folder of your repositories) where you put your hooks
Then create a batch file containing the following code (change the %%
to %
to run this directly on the command line.):
FOR /D %%I in (*) DO copy .\templates\*.* %%I\hooks\ /Y

Filip De Vos
- 11,568
- 1
- 48
- 60
-
That's a solution I also had in mind, it's probably the only way there is. Do you have any example code maybe? – Youri Oct 21 '11 at 09:46
-
added an example to the answer. – Filip De Vos Oct 21 '11 at 10:17