You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Stromek <st...@realtime.sk> on 2006/08/23 16:23:06 UTC
No hooks triggered!
Hi all,
I am desperate about svn hooks. Subversion is claiming that it
automatically calls hooks if they are in place (repos/hooks). Take for
example post-commit. I copied post-commit.tmpl to post-commit, set and
checked permissions for executing the hook and tried simple test. Here
is the hook:
#!/bin/sh
/bin/echo "whatever" > "post-commit.log"
I'm using svn protocol and if I perform commit post-commit is not triggered. I
don't know where to check whether svn is really triggering this hook. Is
it possible to turn on some verbose log? Or something else where I can
see why this hook is not called? Or is there anybody with any idea that
I can try? Thanks!
--
Stromek
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: No hooks triggered!
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Aug 24, 2006, at 09:02, Stromek wrote:
> On Wed, Aug 23, 2006 at 07:33:25PM +0200, Ryan Schmidt wrote:
>
>> It probably is triggered, you just haven't told it where to put the
>> file. Use only absolute paths in hook scripts, or else set $PATH at
>> the beginning to what you want it to be.
>>
>>
>> #!/bin/sh
>> /bin/echo "whatever" > "/tmp/post-commit.log"
>
> strange but it works. Before, it did not create any file in any
> directory (I used find / -name "post-commit.log") to check it.
> However, post-commit is triggered and the log file is created now.
On Windows, the path is set to something weird, and so files you
create with relative paths do get created, but probably not where you
wanted them. On Unix/Linux/Mac OS X, the path is empty, so files you
try to create with relative paths do not get created anywhere. In
both cases, you should use absolute paths.
> It is strange because in the svn book it is said that scripts called
> from the particular hook should be in the repos/hooks to be called
> without
> specifying the path to them. See for example post-commit.tmpl, it
> calls:
>
> commit-email.pl "$REPOS" "$REV" example@example.org
>
> This does not work for me. If I specify full path
> (repos/hooks/commit-email.pl) it works fine. I don't know why this
> didn't
> work for me before when I used the script from default system path
> (/usr/share...) but it does not matter now.
That is correct; it cannot work if you just call the script without
specifying the path to it, unless you first define the path
correctly. The example hook script doesn't attempt to do either,
which is confusing. Perhaps the example hook script should be improved.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: No hooks triggered!
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Aug 23, 2006, at 18:23, Stromek wrote:
> I am desperate about svn hooks. Subversion is claiming that it
> automatically calls hooks if they are in place (repos/hooks). Take for
> example post-commit. I copied post-commit.tmpl to post-commit, set and
> checked permissions for executing the hook and tried simple test. Here
> is the hook:
>
> #!/bin/sh
>
> /bin/echo "whatever" > "post-commit.log"
>
> I'm using svn protocol and if I perform commit post-commit is not
> triggered. I
> don't know where to check whether svn is really triggering this
> hook. Is
> it possible to turn on some verbose log? Or something else where I can
> see why this hook is not called? Or is there anybody with any idea
> that
> I can try? Thanks!
It probably is triggered, you just haven't told it where to put the
file. Use only absolute paths in hook scripts, or else set $PATH at
the beginning to what you want it to be.
#!/bin/sh
/bin/echo "whatever" > "/tmp/post-commit.log"
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: No hooks triggered!
Posted by Tommy Nordgren <to...@chello.se>.
On Aug 23, 2006, at 6:23 PM, Stromek wrote:
> Hi all,
>
> I am desperate about svn hooks. Subversion is claiming that it
> automatically calls hooks if they are in place (repos/hooks). Take for
> example post-commit. I copied post-commit.tmpl to post-commit, set and
> checked permissions for executing the hook and tried simple test. Here
> is the hook:
>
The script may not have execute permission for the particular user,
or group
that svnserve (svn and http urls) and svn (file urls) runs as.
Check group flags on the script, and to which owner and group it
belongs.
In particular, when running the cp command, the owner and group of the
file is set to the owner and default group of the administration
account from which cp
is run.
-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
tommy.nordgren@chello.se
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org