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

Re: implementing hook scripts for the first time

From: Ryan Schmidt <subversion-2008c_at_ryandesign.com>
Date: Mon, 10 Nov 2008 14:38:40 -0600

On Nov 10, 2008, at 09:04, Adam Downer wrote:

> I am starting to apply hook scripts to my repository and I have a
> quick query about how they are set up as the subversion system is
> still relatively new to me.
>
> Reading the book, it appears that you need to have a file called
> post-commit for subversion to call. I can then use this script to
> call all the other scripts I want to run during a post commit. Can
> I place these secondary scripts in a directory called ‘post-commit’
> inside the hooks directory? Will this work reliably?
>
> i.e. The post-commit file will have contents like this:
>
> REPOS="$1"
> REV="$2"
>
> perl ./post-commit-scripts/email.pl REPOS REV
> python ./post-commit-scripts/something-else.py REPOS REV
>
> The book doesn’t seem to suggest that this is possible and makes me
> think I need to put all my operations in one huge script file
> called post-commit for it to work. Obviously being able to split
> things up a bit means it will be more manageble for me.

You can call as many scripts as you like from your post-commit hook.
They can be anywhere you want. But you won't be able to call them
with e.g. "perl ./post-commit-scripts/email.pl" because the hooks run
in an empty environment and as such have no idea what their current
directory is. You have to use absolute paths, e.g. "perl /path/to/my/
repository/hooks/post-commit-scripts/email.pl".

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-11-10 21:39:05 CET

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

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