You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Hutchinson, Greg" <Gr...@fcc-fac.ca> on 2008/11/28 20:01:10 UTC
Returning Warnings from Subversion Hooks
Sometimes it would be useful to return a warning in a post-commit-hook. (The class you checked in contains raw types, you should consider fixing.)
However, it is our understanding that if we write anything to Stderr it will not make it back to the client unless the hook returns non-zero. Is this correct? and does anyone else see this as a useful feature?
Thanks,
Greg Hutchinson, B.Sc.
Principal Application Developer /Développeur principal
Farm Credit Canada / Financement agricole Canada
1800 Hamilton Street, P.O. Box 4320
1800, rue Hamilton, C.P. 4320
Regina SK S4P 4L3
Tel/Tél. : (306) 780-3990 Cell : (306) 539-9060 Fax/Télec. : (306) 780-5655
E-mail/Courriel : greg.hutchinson@fcc-fac.ca <ma...@fcc-fac.ca>
Advancing the business of agriculture. Pour l'avenir de l'agroindustrie.
Please consider the environment before printing this e-mail. Pensons à l'environnement avant d'imprimer ce courriel.
Re: Returning Warnings from Subversion Hooks
Posted by David Weintraub <qa...@gmail.com>.
If you have something that you want to tell the client, but don't want to
cause the hook to fail, consider a post-commit hook. A failing post-commit
hook will return whatever is in STDERR to the client, but it will still
allow the commit transaction to take place.
As for debugging a pre-commit hook, consider writing the output of a hook to
a log file or process. Subversion only grabs STDOUT and STDERR. Other output
processes are still permitted.
It can be a pain, but it's better than the way Perforce does it. In
Perforce, it outputs STDOUT on failed hooks and not STDERR. That means if
your hook printed out some sort of error message (Disk Space Full), it
doesn't get returned to you.
--
David Weintraub
qazwart@gmail.com
On Fri, Nov 28, 2008 at 3:01 PM, Hutchinson, Greg <
Greg.Hutchinson@fcc-fac.ca> wrote:
> Sometimes it would be useful to return a warning in a post-commit-hook.
> (The class you checked in contains raw types, you should consider fixing.)
>
> However, it is our understanding that if we write anything to Stderr it
> will not make it back to the client unless the hook returns non-zero. Is
> this correct? and does anyone else see this as a useful feature?
>
> Thanks,
>
>
>
> *Greg Hutchinson, B.Sc.*
> *Principal Application Developer /**Développeur principal*
> *Farm Credit Canada / Financement agricole Canada*
> 1800 Hamilton Street, P.O. Box 4320
> 1800, rue Hamilton, C.P. 4320
> Regina SK S4P 4L3
> Tel/Tél. : (306) 780-3990 Cell : (306) 539-9060 Fax/Télec. : (306) 780-5655
> E-mail/Courriel : greg.hutchinson@fcc-fac.ca **
>
> *Advancing the business of agriculture. Pour l'avenir de l'agroindustrie.*
> * *
>
> *Please consider the environment before printing this e-mail. Pensons à
> l'environnement avant **d'imprimer ce courriel.*
>
>
>
Re: Returning Warnings from Subversion Hooks
Posted by Mark Eichin <ei...@gmail.com>.
I've had a couple of cases where it would be useful... the biggest is
debugging hooks that are going to fail when they go live but aren't quite
ready yet, but warnings about keywords and mime types would be a lot less
obnoxious than the current must-fail mechanism...
On Nov 29, 2008 12:22 PM, "Hutchinson, Greg" <Gr...@fcc-fac.ca>
wrote:
Sometimes it would be useful to return a warning in a post-commit-hook.
(The class you checked in contains raw types, you should consider fixing.)
However, it is our understanding that if we write anything to Stderr it will
not make it back to the client unless the hook returns non-zero. Is this
correct? and does anyone else see this as a useful feature?
Thanks,
*Greg Hutchinson, B.Sc.*
*Principal Application Developer /**Développeur principal*
*Farm Credit Canada / Financement agricole Canada*
1800 Hamilton Street, P.O. Box 4320
1800, rue Hamilton, C.P. 4320
Regina SK S4P 4L3
Tel/Tél. : (306) 780-3990 Cell : (306) 539-9060 Fax/Télec. : (306) 780-5655
E-mail/Courriel : greg.hutchinson@fcc-fac.ca **
*Advancing the business of agriculture. Pour l'avenir de l'agroindustrie.**
*
*Please consider the environment before printing this e-mail. Pensons à
l'environnement avant **d'imprimer ce courriel.*
Re: Returning Warnings from Subversion Hooks
Posted by Toby Thain <to...@telegraphics.com.au>.
On 29-Nov-08, at 2:58 PM, Ryan Schmidt wrote:
>
> On Nov 28, 2008, at 14:01, Hutchinson, Greg wrote:
>
>> Sometimes it would be useful to return a warning in a post-commit-
>> hook. (The class you checked in contains raw types, you should
>> consider fixing.)
>> However, it is our understanding that if we write anything to
>> Stderr it will not make it back to the client unless the hook
>> returns non-zero. Is this correct?
>
> That is correct, so to issue non-fatal warnings from your post-
> commit hook, you must send it via another means, for example by email.
Yes... I've set up several systems where commits were announced by
Jabber*.
It would be easy to send warnings this way. A multi-user chat would
then act as a form of public shaming. :)
--Toby
* - I wrote this bot & hooks for the purpose:
http://www.telegraphics.com.au/svn/jabberbots/trunk/
>
> To give an example, in the MacPorts project, we run a script in
> post-commit to check the syntax of committed files, and if they
> don't pass, we send an email to the committer with the syntax
> checker report.
>
> http://trac.macports.org/browser/trunk/base/portmgr/jobs/
> portfile_lint.pl
>
>> and does anyone else see this as a useful feature?
>
>
> ---------------------------------------------------------------------
> 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
Re: Returning Warnings from Subversion Hooks
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Nov 28, 2008, at 14:01, Hutchinson, Greg wrote:
> Sometimes it would be useful to return a warning in a post-commit-
> hook. (The class you checked in contains raw types, you should
> consider fixing.)
> However, it is our understanding that if we write anything to
> Stderr it will not make it back to the client unless the hook
> returns non-zero. Is this correct?
That is correct, so to issue non-fatal warnings from your post-commit
hook, you must send it via another means, for example by email.
To give an example, in the MacPorts project, we run a script in post-
commit to check the syntax of committed files, and if they don't
pass, we send an email to the committer with the syntax checker report.
http://trac.macports.org/browser/trunk/base/portmgr/jobs/
portfile_lint.pl
> and does anyone else see this as a useful feature?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org