Currently, the hook scripts is under the repos/hooks,however,there are several projects in the same repository,if any of project is commited, the post-commit hook will be triggered. Now,if I want to trigger the post-commit hook only one of the projects commited, is there any way to solve the problem?
Asked
Active
Viewed 272 times
1
-
2possible duplicate of [Post-commit hook that performs an action only if commit affects the specific path](http://stackoverflow.com/questions/11521100/post-commit-hook-that-performs-an-action-only-if-commit-affects-the-specific-pat) – Jader Dias Jan 29 '13 at 00:20
1 Answers
1
There can be only one top-level post-commit hook but within the top-level script you can trigger other scripts based on the Repository input parameter.
Command-line input parameter to the post-commit hook has the first parameter as 'repository path' (http://svnbook.red-bean.com/nightly/en/svn.ref.reposhooks.post-commit.html).
So you could write a script like this pseudo code:
If path is project1
call script1
Else If path is project2
call script2
....

gammay
- 5,957
- 7
- 32
- 51