Giulio Troccoli a écrit :


Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851    VAT Reg No 778499447

-----Original Message-----


From: Bastien Semene [mailto:bsem...@cyanide-studio.com]
Sent: 21 January 2010 14:07
To: users@subversion.apache.org
Subject: post-commit hook stderr not marshalled back

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. :)

Why don't you just redirect directly to stderr like

/usr/bin/grep revision -f $1/hooks/revision > stderr

And shouldn't exit 1 be on another line?

Actually it seems there's a problem with my mail, "exit 1" is on another line (the double quote was also on another line). I didn't know the shorcut to redirect to stderr, but I think this will not answer my problem as the test to a file writing worked.

I'll give a look to this "> stderr", thanks.

--
Bastien Semene
Administrateur Réseau & Système

ad...@cyanide-studio.com
+33 (0)1 47 86 30 80

Cyanide S.A.
5, Boulevard des Bouvets
92000 Nanterre - FRANCE

Reply via email to