You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Bradley Wagner <br...@hannonhill.com> on 2006/05/01 21:46:06 UTC

post-commit hook not firing over svn+ssh (Subclipse)

Hi,
I'm having trouble getting my post-commit script to fire. I have set  
it to be executable by everyone. It works when I manually invoke it  
on a particular revision:

env - ./post-commit /usr/local/svn/repos/ 3902

However, when a commit occurs, nothing happens. The script is  
definitely in the hooks directory of the working repository and is  
accessible by everyone. I have yet to try it from the command line  
over svn+ssh (i've been committing in subclipse), but I take it that  
will not work either. Any ideas?

Bradley

--
Bradley Mitchell Wagner
Software Developer
Hannon Hill Corporation
main: (678) 904-6900 ext. 115
email: bradley.wagner@hannonhill.com



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

Re: post-commit hook not firing over svn+ssh (Subclipse)

Posted by Bradley Wagner <br...@hannonhill.com>.
I verified that the post-commit does not get fired when committing  
from the command line either, so it's not a Subclipse problem.

On May 1, 2006, at 5:46 PM, Bradley Wagner wrote:

> Hi,
> I'm having trouble getting my post-commit script to fire. I have  
> set it to be executable by everyone. It works when I manually  
> invoke it on a particular revision:
>
> env - ./post-commit /usr/local/svn/repos/ 3902
>
> However, when a commit occurs, nothing happens. The script is  
> definitely in the hooks directory of the working repository and is  
> accessible by everyone. I have yet to try it from the command line  
> over svn+ssh (i've been committing in subclipse), but I take it  
> that will not work either. Any ideas?
>
> Bradley
>
> --
> Bradley Mitchell Wagner
> Software Developer
> Hannon Hill Corporation
> main: (678) 904-6900 ext. 115
> email: bradley.wagner@hannonhill.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>


--
Bradley Mitchell Wagner
Software Developer
Hannon Hill Corporation
main: (678) 904-6900 ext. 115
email: bradley.wagner@hannonhill.com



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

Re: post-commit hook not firing over svn+ssh (Subclipse)

Posted by Bradley Wagner <br...@hannonhill.com>.
Ryan,
You're absolutely right. When I made that an absolute path,  
everything worked fine. Thanks a lot.

Bradley

On May 1, 2006, at 6:16 PM, Ryan Schmidt wrote:

> Please send replies to the list too, so everyone can benefit from  
> the discussion.
>
>
> On May 2, 2006, at 00:08, Bradley Wagner wrote:
>
>>> The standard advice is to make sure that all paths in the script  
>>> are absolute, and to insert "echo" statements at strategic points  
>>> in the script which send output to a logfile which you can check  
>>> to see if the script is reaching a particular line.
>>>
>>> If you can send us your hook script, maybe we can see the problem...
>>
>> Here's my post-commit script:
>
> [snip]
>
>> REPOS="$1"
>> REV="$2"
>>
>> ./commit-email.pl "$REPOS" "$REV" bradley.wagner@hannonhill.com
>> # log-commit.py --repository "$REPOS" --revision "$REV"
>>
>> and the commit-email lives in the same directory and is just the  
>> out of the box commit-email.pl script with execute privileges for  
>> everyone.
>
> Yes, you'll have to specify the absolute path to that. Hook scripts  
> run without an incredibly minimal environment, including without a  
> current working directory (on Unix-like systems; on Windows  
> systems, I'm told, the current working directory is set, though  
> it's not the one that might be expected, so using absolute paths is  
> still recommended).
>
> /complete/path/to/commit-email.pl "$REPOS" "$REV" email@addy
>
>
>> Can I just pipe "echo" to a file: "echo 'here' > log.debug"?
>
> Right, except again you'll have to specify the full path to the file.
>
> echo before sending mail > /complete/path/to/log.debug
>
> I believe /bin is in the PATH when the hook runs, so it's not  
> necessary to call "echo" as "/bin/echo", though, of course, if it  
> fails, try calling it as /bin/echo instead.
>
>


--
Bradley Mitchell Wagner
Software Developer



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

Re: post-commit hook not firing over svn+ssh (Subclipse)

Posted by Ryan Schmidt <su...@ryandesign.com>.
Please send replies to the list too, so everyone can benefit from the  
discussion.


On May 2, 2006, at 00:08, Bradley Wagner wrote:

>> The standard advice is to make sure that all paths in the script  
>> are absolute, and to insert "echo" statements at strategic points  
>> in the script which send output to a logfile which you can check  
>> to see if the script is reaching a particular line.
>>
>> If you can send us your hook script, maybe we can see the problem...
>
> Here's my post-commit script:

[snip]

> REPOS="$1"
> REV="$2"
>
> ./commit-email.pl "$REPOS" "$REV" bradley.wagner@hannonhill.com
> # log-commit.py --repository "$REPOS" --revision "$REV"
>
> and the commit-email lives in the same directory and is just the  
> out of the box commit-email.pl script with execute privileges for  
> everyone.

Yes, you'll have to specify the absolute path to that. Hook scripts  
run without an incredibly minimal environment, including without a  
current working directory (on Unix-like systems; on Windows systems,  
I'm told, the current working directory is set, though it's not the  
one that might be expected, so using absolute paths is still  
recommended).

/complete/path/to/commit-email.pl "$REPOS" "$REV" email@addy


> Can I just pipe "echo" to a file: "echo 'here' > log.debug"?

Right, except again you'll have to specify the full path to the file.

echo before sending mail > /complete/path/to/log.debug

I believe /bin is in the PATH when the hook runs, so it's not  
necessary to call "echo" as "/bin/echo", though, of course, if it  
fails, try calling it as /bin/echo instead.



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

Re: post-commit hook not firing over svn+ssh (Subclipse)

Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 1, 2006, at 23:46, Bradley Wagner wrote:

> I'm having trouble getting my post-commit script to fire. I have  
> set it to be executable by everyone. It works when I manually  
> invoke it on a particular revision:
>
> env - ./post-commit /usr/local/svn/repos/ 3902
>
> However, when a commit occurs, nothing happens. The script is  
> definitely in the hooks directory of the working repository and is  
> accessible by everyone. I have yet to try it from the command line  
> over svn+ssh (i've been committing in subclipse), but I take it  
> that will not work either. Any ideas?

The standard advice is to make sure that all paths in the script are  
absolute, and to insert "echo" statements at strategic points in the  
script which send output to a logfile which you can check to see if  
the script is reaching a particular line.

If you can send us your hook script, maybe we can see the problem...



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