You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Timo Einsiedler-Burger <so...@gmx.de> on 2009/04/02 17:25:58 UTC

post-commit hook does not show message at client

Hello,

please can someone help me out on this one! I have spent hours of searching but did not turn up with anything useful, so far.

My hook code:
#!/bin/sh

REPOS="$1"
REV="$2"

/usr/bin/svnlook changed -r $REV $REPOS 2>&1 | tee -a /tmp/svntest.log
echo "POST_COMMIT_HOOK - path: $REPOS, revision: $REV" 2>&1 | tee -a /tmp/svntest.log

Everything works fine ... hook gets executed and log file written. When i call it directly on the server i do get the log output on my prompt. However i do not get the log output displayed on my client from which i execute the commit. This is a problem, because i want to notify the user! I know i could use email for that as well, but i want direct notification upon committing.

My clients use commandline (from linux box) and connect via svn+ssh (could this be a problem???).
As far as i understand the output should get displayed at the client.

Thanks and take care!!!
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1521513

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: post-commit hook does not show message at client

Posted by Timo Einsiedler Burger <so...@gmx.de>.
Yes, you are right, it would be confusing.
But I want to notify the client in case there are related files he/she 
should consider to update as well.
So i will make it fail only in case the server finds those (rule based) 
files. In that case the client receives
a warning that the post-commit hook failed with the STDERR and STDOUT i want 
to show.
Unless subversion provides a feature unknown to me, this fits my needs 
allright, as the commit goes through anyway.

Thanks again!

----- Original Message ----- 
From: "David Weintraub" <qa...@gmail.com>
To: "Timo Einsiedler-Burger" <so...@gmx.de>
Cc: <us...@subversion.tigris.org>
Sent: Friday, April 03, 2009 4:34 PM
Subject: Re: post-commit hook does not show message at client


> On Fri, Apr 3, 2009 at 4:24 AM, Timo Einsiedler-Burger <so...@gmx.de> 
> wrote:
>>  thanks for the quick reply. I must have got the messaging part wrong, 
>> then.
>>  Well, anyway good to know how it should work.
>> I guess I will make it fail in purpose just to notify the client.
>
> One thing I should mention about this. I believe when you fail a
> post-commit hook, the client will get a failure message, and then what
> you sent on STDERR. It might be a bit confusing to the clients to see
> an error, and then your "Everything is Okay" message.
>
> Play around with it, and let us know what happens.
>
> -- 
> David Weintraub
> qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1533847

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: post-commit hook does not show message at client

Posted by David Weintraub <qa...@gmail.com>.
On Fri, Apr 3, 2009 at 4:24 AM, Timo Einsiedler-Burger <so...@gmx.de> wrote:
>  thanks for the quick reply. I must have got the messaging part wrong, then.
>  Well, anyway good to know how it should work.
> I guess I will make it fail in purpose just to notify the client.

One thing I should mention about this. I believe when you fail a
post-commit hook, the client will get a failure message, and then what
you sent on STDERR. It might be a bit confusing to the clients to see
an error, and then your "Everything is Okay" message.

Play around with it, and let us know what happens.

-- 
David Weintraub
qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1532820

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: post-commit hook does not show message at client

Posted by Timo Einsiedler-Burger <so...@gmx.de>.
Hello,

thanks for the quick reply. I must have got the messaging part wrong, then. Well, anyway good to know how it should work. I guess I will make it fail in purpose just to notify the client.

All of the other mentioned messaging systems could be implemented as a add-on, but I really need direct feedback and cannot trust that developers have IM, SMS, etc.

Maybe this could be an issue for a CR?

Take care, Timo. 

-------- Original-Nachricht --------
> Datum: Thu, 2 Apr 2009 14:21:32 -0400
> Von: David Weintraub <qa...@gmail.com>
> An: Timo Einsiedler-Burger <so...@gmx.de>
> CC: users@subversion.tigris.org
> Betreff: Re: post-commit hook does not show message at client

> Hooks don't display STDOUT. They display STDERR, but only if the hook
> itself fails.
> 
> Remember that the hook executes on the server side and not the client
> side, so there is no way to show the output to the client unless the
> hook script is able to directly talk to the client side.
> 
> Almost all of the server-side hook executing CM systems I know don't
> send anything back to the client until after the hook script has
> executed, and then only upon failure. So, Subversion isn't unusual in
> this effort.
> 
> Since this is a post-commit hook, you could purposely fail the hook
> (the commit has already taken place anyway), and that will get the
> message back to the client.
> 
> Another is to use IM, SMS, or Twitter to notify the client which is
> becoming more and more  popular with many software companies.
> 
> On Thu, Apr 2, 2009 at 1:25 PM, Timo Einsiedler-Burger <so...@gmx.de>
> wrote:
> > Hello,
> >
> > please can someone help me out on this one! I have spent hours of
> searching but did not turn up with anything useful, so far.
> >
> > My hook code:
> > #!/bin/sh
> >
> > REPOS="$1"
> > REV="$2"
> >
> > /usr/bin/svnlook changed -r $REV $REPOS 2>&1 | tee -a /tmp/svntest.log
> > echo "POST_COMMIT_HOOK - path: $REPOS, revision: $REV" 2>&1 | tee -a
> /tmp/svntest.log
> >
> > Everything works fine ... hook gets executed and log file written. When
> i call it directly on the server i do get the log output on my prompt.
> However i do not get the log output displayed on my client from which i execute
> the commit. This is a problem, because i want to notify the user! I know i
> could use email for that as well, but i want direct notification upon
> committing.
> >
> > My clients use commandline (from linux box) and connect via svn+ssh
> (could this be a problem???).
> > As far as i understand the output should get displayed at the client.
> >
> > Thanks and take care!!!
> > --
> > Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit
> allen: http://www.gmx.net/de/go/multimessenger01
> >
> > ------------------------------------------------------
> >
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1521513
> >
> > To unsubscribe from this discussion, e-mail:
> [users-unsubscribe@subversion.tigris.org].
> >
> 
> 
> 
> -- 
> David Weintraub
> qazwart@gmail.com
> 
> All attachments have been scanned for viruses and have been found to
> be virus free. So,  just go ahead and open them. Go ahead... Just
> click on it... Trust me.

-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1530162

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re[2]: post-commit hook does not show message at client

Posted by Andrey Repin <an...@freemail.ru>.
Greetings, David Weintraub!

DW> Hooks don't display STDOUT. They display STDERR, but only if the hook
DW> itself fails.

DW> Since this is a post-commit hook, you could purposely fail the hook
DW> (the commit has already taken place anyway), and that will get the
DW> message back to the client.

Mm... interesting trick! *taking notes*


--
WBR,
 Andrey Repin (anrdaemon@freemail.ru) 02.04.2009, <22:29>

Sorry for my terrible english...

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1522504

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: post-commit hook does not show message at client

Posted by David Weintraub <qa...@gmail.com>.
Hooks don't display STDOUT. They display STDERR, but only if the hook
itself fails.

Remember that the hook executes on the server side and not the client
side, so there is no way to show the output to the client unless the
hook script is able to directly talk to the client side.

Almost all of the server-side hook executing CM systems I know don't
send anything back to the client until after the hook script has
executed, and then only upon failure. So, Subversion isn't unusual in
this effort.

Since this is a post-commit hook, you could purposely fail the hook
(the commit has already taken place anyway), and that will get the
message back to the client.

Another is to use IM, SMS, or Twitter to notify the client which is
becoming more and more  popular with many software companies.

On Thu, Apr 2, 2009 at 1:25 PM, Timo Einsiedler-Burger <so...@gmx.de> wrote:
> Hello,
>
> please can someone help me out on this one! I have spent hours of searching but did not turn up with anything useful, so far.
>
> My hook code:
> #!/bin/sh
>
> REPOS="$1"
> REV="$2"
>
> /usr/bin/svnlook changed -r $REV $REPOS 2>&1 | tee -a /tmp/svntest.log
> echo "POST_COMMIT_HOOK - path: $REPOS, revision: $REV" 2>&1 | tee -a /tmp/svntest.log
>
> Everything works fine ... hook gets executed and log file written. When i call it directly on the server i do get the log output on my prompt. However i do not get the log output displayed on my client from which i execute the commit. This is a problem, because i want to notify the user! I know i could use email for that as well, but i want direct notification upon committing.
>
> My clients use commandline (from linux box) and connect via svn+ssh (could this be a problem???).
> As far as i understand the output should get displayed at the client.
>
> Thanks and take care!!!
> --
> Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1521513
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
>



-- 
David Weintraub
qazwart@gmail.com

All attachments have been scanned for viruses and have been found to
be virus free. So,  just go ahead and open them. Go ahead... Just
click on it... Trust me.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1522326

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].