You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by David Wheeler <da...@kineticode.com> on 2004/10/01 19:53:08 UTC

Hooks in 1.1

Hi All,

I've set up my Subversion 1.1 server to use hooks by:

* Creating pre-commit and post-commit in the hooks directory
* chmod +x each of them
* chown to the Apache user
* sudo -u $APACHE_USER ./post-commit $REPOS $REVISION # works in the 
shell!

But they're not working. Subversion doesn't seem to notice them at all, 
they simply don't execute. I tried restarting Apache, but nothing. Am I 
missing some important configuration somewhere to tell Subversion to 
execute these scripts?

TIA,

David


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Hooks in 1.1

Posted by David Wheeler <da...@kineticode.com>.
On Oct 1, 2004, at 1:26 PM, Mark Phippard wrote:

>> Hrm, yes, that *does* work. I wonder why my script is failing, then.
>> Pity nothing seems to be showing up in the Apache error_log...
>
> Apache didn't have a problem, the script did.  You would need to make 
> the
> script catch the errors and output them to some place you can look at
> them.

I've got it working now. It was an extension of the path problem. Once 
I specified the complete path to svnlook in my script, it worked.

Thanks Mark and Jani for the help!

Regards,

David


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Hooks in 1.1

Posted by Mark Phippard <Ma...@softlanding.com>.
> > 1) Are you using absolute paths to your executables inside the hook?
> >    The environment of hook in which the hook gets executed is really
> >    bare and anemic.
> 
> That doesn't seem to help.

I am not a Unix person, but isn't there something like a PATH that would 
beed to be set so that the executable could find its dependencies?

> Hrm, yes, that *does* work. I wonder why my script is failing, then. 
> Pity nothing seems to be showing up in the Apache error_log...

Apache didn't have a problem, the script did.  You would need to make the 
script catch the errors and output them to some place you can look at 
them.

Mark


_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. by IBM Email Security Management Services powered by MessageLabs. 
_____________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Hooks in 1.1

Posted by David Wheeler <da...@kineticode.com>.
On Oct 1, 2004, at 1:05 PM, Jani Averbach wrote:

> 1) Are you using absolute paths to your executables inside the hook?
>    The environment of hook in which the hook gets executed is really
>    bare and anemic.

That doesn't seem to help.

> 2) If the above didn't help, try create something really simple,
>    like
>
>    /bin/date >> /tmp/post-commit.log
>
>    as your post-commit hook and see if it works.

Hrm, yes, that *does* work. I wonder why my script is failing, then. 
Pity nothing seems to be showing up in the Apache error_log...

Regards,

David


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Hooks in 1.1

Posted by Jani Averbach <ja...@jaa.iki.fi>.
On 2004-10-01 12:53-0700, David Wheeler wrote:
> Hi All,
> 
> I've set up my Subversion 1.1 server to use hooks by:
> 
> * Creating pre-commit and post-commit in the hooks directory
> * chmod +x each of them
> * chown to the Apache user
> * sudo -u $APACHE_USER ./post-commit $REPOS $REVISION # works in the 
> shell!
> 
> But they're not working. Subversion doesn't seem to notice them at all, 
> they simply don't execute. I tried restarting Apache, but nothing. Am I 
> missing some important configuration somewhere to tell Subversion to 
> execute these scripts?

Two things came to my mind:

1) Are you using absolute paths to your executables inside the hook?
   The environment of hook in which the hook gets executed is really
   bare and anemic.

2) If the above didn't help, try create something really simple,
   like

   /bin/date >> /tmp/post-commit.log

   as your post-commit hook and see if it works.

BR, Jani

http://subversion.tigris.org/project_faq.html#hook-environment
http://svnbook.red-bean.com/svnbook-1.1/ch05s02.html#svn-ch-5-sect-2.1

-- 
Jani Averbach


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org