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

post-commit hook stderr not marshalled back

From: Bastien Semene <bsemene_at_cyanide-studio.com>
Date: Thu, 21 Jan 2010 15:06:45 +0100

Hi list,

I currently can't get the stderr output of the post-commit hook script
back to the client.

The goal of this part of this post-commit hook script is to update a
specific working copy when someone commit on a particular folder, and
the commiter to verify the version of this working copy.

Everything works fine except that the client (Tortoise) doesn't display
the version of the working copy.

To display the new version of the working copy, I've done a nasty hack
to redirect the stdout to stderr so svn should marshalled back the
message to the client as described in the documentation :
"If the post-commit hook returns a nonzero exit status, the commit will
not be aborted since it has already completed. However, anything that
the hook printed to stderr will be marshalled back to the client, making
it easier to diagnose hook failures."

This is the interesting part of my script :
"
#!/bin/sh
[...]
/usr/bin/grep revision -f $1/hooks/revision 1>&2
exit 1
"

When I add 2>test before 1>&2, it works, so stdout is correctly
redirected to stderr. The exit 1 should correctly send a nonzero exit
status.
So, I don't know what's wrong.

If someone can help this will be great. :)

-- 
Bastien Semene
Administrateur Réseau & Système
admin_at_cyanide-studio.com
+33 (0)1 47 86 30 80
Cyanide S.A.
5, Boulevard des Bouvets
92000 Nanterre - FRANCE
Received on 2010-01-21 15:07:23 CET

This is an archived mail posted to the Subversion Users mailing list.