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

RE: RE: Hook Script problem with no error output

From: Srilakshmanan, Lakshman <lakshman.srilakshmanan_at_police.vic.gov.au>
Date: 2007-10-12 05:02:25 CEST

Hi,
 
To test your script you can do the following.
 
1) remove every thing from the script.
2) put a single line --> exit 0
3) Using CLI commit a file.
 
If the above works then you can be confident svn is calling your
pre-commit hook and succeeding.
If the above does not work then we can be sure that there is an issue
calling your pre-commit hook.
 
The reason I include exit 0 is because svn expects a zero from the
pre-commit hook to determine whether to abort or proceed with a commit.
If a command in a script fails then the return code is non zero. I know
the argument that if the command succeeds then the return value is zero
therefore we do not need to explicitly code for exit 0. I personally
find it a good practise and the script becomes more readable.
 
3) include echo "This is a test" 1>&2
4) exit 0
5) Using CLI commit a file.
 
this should echo the output to your CLI.
 
Thanks
Lakshman

________________________________

From: Kostas Rondinoulis [mailto:rondinos@hotmail.com]
Sent: Friday, 12 October 2007 4:06 AM
To: Jeremy Pereira
Cc: users@subversion.tigris.org
Subject: RE: Hook Script problem with no error output

No, that's not possible. svn user is svn, /tmp/svn-test.log belongs to
svn user but it also has 666 permissions and anybody can read and write
there. I don't believe it's a permission issue, I wish I had a way to
find out how I can debug it, I installed svn with debugging but it
doesn't give me anything even when I run it in foreground.

________________________________

> CC: users@subversion.tigris.org
> From: jeremyp@jeremyp.net
> Date: Thu, 11 Oct 2007 13:17:47 +0100
> To: rondinos@hotmail.com
> Subject: Re: Hook Script problem with no error output
>
>
> On 10 Oct 2007, at 21:42, Kostas Rondinoulis wrote:
>
> > I am very surprised why my hooks script don't work.
> >
> > I just made a pre-commit script with one line:
> > /bin/echo "Script is running" >> /tmp/svn-test.log
> >
> > I am not using any enviroment variables, so my script works
> > perfectly in an empty enviroment and the permissions are set
properly.
> > I have tested with env - ./pre-commit and the script works
> > perfectly. I have tried to run the server in the foreground, but it
> > doesn't give me any output there either.
> >
> > When I try to commit, I get the following error:
> >
> > [rondin@webdev ~/html]$ svn ci -m "testing" .
> > Deleting test5
> > Adding test6
> > subversion/libsvn_client/commit.c:865: (apr_err=165001)
> > svn: Commit failed (details follow):
> > subversion/libsvn_repos/hooks.c:135: (apr_err=165001)
> > svn: 'pre-commit' hook failed with error output:
> >
> > I am running svnserve, version 1.4.4 (r25188).
> >
> > Is there any way to find out why the scripts are not working and
> > why am I getting a blank error output?
> >
>
> Is it possible that the file /tmp/svn-test.log is not writeable by
> the user that the Subversion server is running as?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>

________________________________

Invite your mail contacts to join your friends list with Windows Live
Spaces. It's easy! Try it!
<http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.
aspx&mkt=en-us>

================================================================================================
EMAIL DISCLAIMER

This email and any attachments are confidential. They may also be subject to copyright.

If you are not an intended recipient of this email please immediately contact us by replying
to this email and then delete this email.

You must not read, use, copy, retain, forward or disclose this email or any attachment.

We do not accept any liability arising from or in connection with unauthorised use or disclosure
of the information contained in this email or any attachment.

We make reasonable efforts to protect against computer viruses but we do not accept liability
for any liability, loss or damage caused by any computer virus contained in this email.
================================================================================================
Received on Fri Oct 12 05:02:32 2007

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.