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/02/26 12:09:43 UTC
svn behavior when the 'post-commit' hook fails
After a commit (svn client 1.5.x, svn server 1.4.x IIRC), I got:
------------------------------------------------------------------
Sending www/index.html
Transmitting file data .
Committed revision 5987.
Warning: 'post-commit' hook failed with error output:
------------------------------------------------------------------
but no error output (except a blank line, which may have been added
by svn). I wonder why such a blank line only. A possible reason is
that the hook process has been killed by the system, but Subversion
doesn't say anything about that. Could Subversion output the exit
status in addition to the possible error message (as this would give
such information)?
Note: the 'post-commit' hook just executes
/usr/lib/subversion/hook-scripts/commit-email.pl ...
and this is the first time I have such an error.
--
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].
Re: svn behavior when the 'post-commit' hook fails
Posted by Vincent Lefevre <vi...@vinc17.org>.
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>.
Are you printing anything to STDERR? 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 put the string "DEBUG:" in front of the stuff where I am simply
printing out debugging information, so developers can tell the
difference between that and the error message I am sending them.
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.
If you've determined that your hook script isn't even running, you
need to check whether or not you're actually calling it from the
post-commit shell script or post-commit batch file.
On Thu, Feb 26, 2009 at 7:09 AM, Vincent Lefevre <vi...@vinc17.org> wrote:
> After a commit (svn client 1.5.x, svn server 1.4.x IIRC), I got:
>
> ------------------------------------------------------------------
> Sending www/index.html
> Transmitting file data .
> Committed revision 5987.
>
> Warning: 'post-commit' hook failed with error output:
>
> ------------------------------------------------------------------
>
> but no error output (except a blank line, which may have been added
> by svn). I wonder why such a blank line only. A possible reason is
> that the hook process has been killed by the system, but Subversion
> doesn't say anything about that. Could Subversion output the exit
> status in addition to the possible error message (as this would give
> such information)?
>
> Note: the 'post-commit' hook just executes
>
> /usr/lib/subversion/hook-scripts/commit-email.pl ...
>
> and this is the first time I have such an error.
>
> --
> 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)
>
>
--
--
David Weintraub
qazwart@gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1233696
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].