You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Vincent Lefevre <vi...@vinc17.org> on 2009/03/12 02:44:21 UTC

Re: svn behavior when the 'post-commit' hook fails

On 2009-02-26 11:27:56 -0500, David Weintraub wrote:
> Are you printing anything to STDERR?

No.

> If not, add a few "print STDERR ..." statements to your post-commit
> trigger. Subversion will only output STDERR when the hook fails and
> never outputs STDOUT. When the hook fails, at least you have some
> information as to what is going on with your program.

I don't want to output such messages in general. Only when the hook
fails. But I don't know why it has failed. Perhaps there's a bug in

  /usr/lib/subversion/hook-scripts/commit-email.pl

but then, this needs to be fixed. The problem is that this error
could never be reproduced. And if the hook script died for some
reason (e.g. a signal), only an error message from Subversion
itself can say what happened (e.g. which signal).

> Put at least one line near the beginning of your hook to simply
> announce that you are executing the hook script. That way, you know
> that the hook script actually executed, and it didn't exit before it
> got to a place where it printed something to STDERR.

Well, since I received the e-mail message, this means that the hook
was executed and commit-email.pl even terminated normally (I suppose).

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


Re: svn behavior when the 'post-commit' hook fails

Posted by David Weintraub <qa...@gmail.com>.
On Wed, Mar 11, 2009 at 10:44 PM, Vincent Lefevre
<vi...@vinc17.org> wrote:
>> If not, add a few "print STDERR ..." statements to your post-commit
>> trigger. Subversion will only output STDERR when the hook fails and
>> never outputs STDOUT. When the hook fails, at least you have some
>> information as to what is going on with your program.
>
> I don't want to output such messages in general. Only when the hook
> fails.

That's the beauty of putting debugging information in STDERR messages:
The hook won't print them when the hook succeeds, only when it fails.

In other words, you can pepper your script with STDERR messages and
leave them there. If the hook works, no one will be the wiser. If the
hook fails, you'll have information why it failed.

--
David Weintraub
qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1313418

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].