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

Re: Returning Warnings from Subversion Hooks

From: David Weintraub <qazwart_at_gmail.com>
Date: Sat, 29 Nov 2008 20:09:25 -0500

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_at_gmail.com
On Fri, Nov 28, 2008 at 3:01 PM, Hutchinson, Greg <
Greg.Hutchinson_at_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_at_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.*
>
>
>
Received on 2008-11-30 02:09:52 CET

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.