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

data written to stderr in pre-commit hook is not output by the client

I've found the following bug in svn 1.2.3 (I don't know if it has been
fixed in 1.3.0, but I've seen nothing about that in the release notes).
I've reported it as Debian bug 354877.

In a pre-commit hook, I have a line

  echo "some message" >&2

as an information message to make sure that some format checking is
done. The Subversion manual says:

  If the hook program writes data to stderr, it will be marshalled
  back to the client.

But this message is output only in case of failure (instead of
everytime).

-- 
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 / SPACES project at LORIA

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: data written to stderr in pre-commit hook is not output by the client

Posted by Greg Hudson <gh...@MIT.EDU>.
On Thu, 2006-03-02 at 11:49 +0100, Vincent Lefevre wrote:
> OK. So, is there any reason not to marshal stderr even when the
> script returns with a zero exit status?

Basically, neither network protocol contains provisions for marshalling
hook script output to the client.  When an error occurs, the stderr data
can be stuffed into an error explanation, but if no error occurs, we
don't have a way to get the information back.

Extending either protocol should be relatively easy, but I'm not sure
whether we want the extra complexity.  It's one thing to include
server-side hooks; it's another to start building them into an
application framework.  (After sending output to the client, the next
feature request will be the ability to request additional input from the
client, and it goes from there.)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: data written to stderr in pre-commit hook is not output by the client

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2006-03-02 08:35:01 +0100, Peter Lundblad wrote:
> This is an error in the book.  Hook script error output is only
> marshalled if the scripts returns a non-zero value.

OK. So, is there any reason not to marshal stderr even when the
script returns with a zero exit status?

Alternatively, stdout could also be marshalled to the client, with
the difference that it would always be output. If I understand
correctly, it is currently not used (otherwise a new file descriptor
could be opened for that). I think it would really be nice to be
able to send information messages to the client, in particular in
the absence of client-side hook scripts.

-- 
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 / SPACES project at LORIA

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: data written to stderr in pre-commit hook is not output by the client

Posted by Peter Lundblad <pe...@famlundblad.se>.
Vincent Lefevre writes:
 > I've found the following bug in svn 1.2.3 (I don't know if it has been
 > fixed in 1.3.0, but I've seen nothing about that in the release notes).
 > I've reported it as Debian bug 354877.
 > 
 > In a pre-commit hook, I have a line
 > 
 >   echo "some message" >&2
 > 
 > as an information message to make sure that some format checking is
 > done. The Subversion manual says:
 > 
 >   If the hook program writes data to stderr, it will be marshalled
 >   back to the client.
 > 

This is an error in the book.  Hook script error output is only
marshalled if the scripts returns a non-zero value.

Thanks,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org