You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Stephen Gross <sg...@darwin.epbi.cwru.edu> on 2005/11/08 14:39:34 UTC

Hook script not running?

I'm trying to get started with hook scripts. I have a file called pre-commit 
that looks like this:

========
#!/bin/sh
echo hi >> log
exit 0
========

The file 'pre-commit' is executable (by all groups) and owned by the http 
daemon (apache). When I commit changes to my svn tree, however, the commit 
script does not appear to run. That is, the file 'log' should be created by 
the script but is not. Any ideas?

Thanks,
--Steve

Stephen Gross
Case Western School of Medicine
Cleveland, OH

"By Grabthar's hammer, by the sons of Worvan, you shall be avenged." - Dr. 
Lazarus 



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

Re: Hook script not running?

Posted by Nick Thompson <ni...@agere.com>.
What happens if you use "/tmp/log" instead of just "log"?

On Tuesday 08 November 2005 14:39, Stephen Gross wrote:
> I'm trying to get started with hook scripts. I have a file called
> pre-commit that looks like this:
>
> ========
> #!/bin/sh
> echo hi >> log
> exit 0
> ========
>
> The file 'pre-commit' is executable (by all groups) and owned by the
> http daemon (apache). When I commit changes to my svn tree, however,
> the commit script does not appear to run. That is, the file 'log'
> should be created by the script but is not. Any ideas?

-- 
> Nick Thompson

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

Re: Hook script not running?

Posted by Greg Thomas <th...@omc.bt.co.uk>.
On Tue, 8 Nov 2005 09:39:34 -0500, "Stephen Gross"
<sg...@darwin.epbi.cwru.edu> wrote:

>========
>#!/bin/sh
>echo hi >> log
>exit 0
>========
...
> the file 'log' should be created by 
>the script but is not. Any ideas?

Where are you looking for 'log' ? Try creating it with an absolute
rather than a relative path.

Greg
-- 
This post represents the views of the author and does
not necessarily accurately represent the views of BT.

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

Re: Hook script not running?

Posted by Stephen Gross <sg...@darwin.epbi.cwru.edu>.
>Last but not least, try a script like this:
#!/bin/sh
exit 1

Aha! Ok, so this works... Thanks!

--Steve


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

Re: Hook script not running?

Posted by Pim Bliek <pi...@frog.nl>.
Hi,

Just some random thoughts on this one:

Since your pre-commit hook tries to write to the file 'log'... has the 
apache user also write access to the directory? If it cannot write it.. 
it won't happen.

Also, have a look at the logs (apache errorlog if you access SVN via 
apache).

Last but not least, try a script like this:
#!/bin/sh
exit 1

If your commit fails with exit level 1, you can be sure that the script 
is fired of in the first place. If so, you can start building and 
debugging the script you intend to run as a pre-commit.

Good luck!
Pim


Stephen Gross wrote:

>I'm trying to get started with hook scripts. I have a file called pre-commit 
>that looks like this:
>
>========
>#!/bin/sh
>echo hi >> log
>exit 0
>========
>
>The file 'pre-commit' is executable (by all groups) and owned by the http 
>daemon (apache). When I commit changes to my svn tree, however, the commit 
>script does not appear to run. That is, the file 'log' should be created by 
>the script but is not. Any ideas?
>
>Thanks,
>--Steve
>
>Stephen Gross
>Case Western School of Medicine
>Cleveland, OH
>
>"By Grabthar's hammer, by the sons of Worvan, you shall be avenged." - Dr. 
>Lazarus 
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>For additional commands, e-mail: users-help@subversion.tigris.org
>
>  
>



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