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

Re: How to output warnings in pre-commit hook?

From: Ryan Schmidt <subversion-2008b_at_ryandesign.com>
Date: Fri, 18 Apr 2008 16:48:31 -0500

On Apr 18, 2008, at 8:47 AM, Olivier Sannier wrote:

> Is there a way to get warning messages sent to the user via a pre-
> commit hook?
> I mean, I can get an error message if the pre-commit hook returns a
> non zero value, but what I would like to do is accept the commit
> while still displaying a warning message that the user will see in
> the result message from his commit.

No, that is not possible. You can only send a message to the client
if you also return a non-zero return value and thereby prevent the
commit.

> This way I can inform of suspicious commits without preventing them
> as the detection of such items can not decide by itself to fail the
> commit.
> I tried to write on STDERR and still return 0 in my pre-commit
> hook, but I could not get the output to show in the output of svn
> commit.

If you want to inform the user of something while also accepting the
commit, you have to do so through other means. For example, the
MacPorts project sends and email to the committer if any non-critical
problems were found with the commit.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-04-18 23:48:56 CEST

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.