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

Re: [svn 1.3.0] post-commit can not running?

From: Ryan Schmidt <subversion-2006Q1_at_ryandesign.com>
Date: 2006-01-08 13:40:04 CET

On Jan 8, 2006, at 13:33, Ryan Schmidt wrote:

> The hooks run with NO environment, not even a PATH, not even the
> notion of what the current directory is. There is no such thing as
> "./" in a hook. You must specify the entire absolute path. So, your
> post-commit should contain this:
>
>
> #!/bin/sh
>
> REPOS="$1"
> REV="$2"
>
> /usr/local/svnrepos/pyblosxom/hooks/post-commit.py
>
>
> And, of course, post-commit.py will need 755 permissions, but I
> imagine you've done that already.

And of course you have to actually pass the arguments along:

#!/bin/sh

REPOS="$1"
REV="$2"

/usr/local/svnrepos/pyblosxom/hooks/post-commit.py "$REPOS" "$REV"

But you already knew that. I just forgot it in my example.

I also wanted to point out that the post-commit.tmpl file provided
with Subversion 1.3.0 already explains the current directory problem:

> # The default working directory for the invocation is undefined, so
> # the program should set one explicitly if it cares.

And of course:

> # The hook program typically does not inherit the environment of
> # its parent process. For example, a common problem is for the
> # PATH environment variable to not be set to its usual value, so
> # that subprograms fail to launch unless invoked via absolute path.
> # If you're having unexpected problems with a hook program, the
> # culprit may be unusual (or missing) environment variables.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Jan 8 13:42:06 2006

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.