You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kristis Makris <mk...@gmx.net> on 2004/07/26 04:06:50 UTC

Subversion hooks

Hello,

I'm trying to implement integration of Subversion with Bugzilla, through
Subversion's hooks mechanism. I noticed that when my hook scripts output
something on stdout, these messages are not visible.
How can I make error messages produced by the hook scripts visible to
the user ?

Also, I was unable to find how a tagging activity is flagged as such in
a transaction. If I can capture a tag name, I can use that tag name in
the integration scripts (e.g. to automatically add that tag name as a
new product version in Bugzilla). How can I capture tags ?

Thanks,
Kristis


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

Re: Subversion hooks

Posted by Kristis Makris <mk...@gmx.net>.
> Use stderr.  In shell scripts, you can do this like:
> 
>    echo "stdout redirected to stderr" 2>&1

It does not work for me in the pre-commit script of svn 1.0.0. I still
don't get anything on the console. Using this pre-commit script:

#!/bin/sh
echo "stdout redirected to stderr" 2>&1 
exit 0;

I only see:

$ svn commit
Sending        a
Transmitting file data .
Committed revision 8.




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

Re: Subversion hooks

Posted by Toby Johnson <to...@etjohnson.us>.
C. Michael Pilato wrote:

>Kristis Makris <mk...@gmx.net> writes:
>  
>
>>Also, I was unable to find how a tagging activity is flagged as such in
>>a transaction. If I can capture a tag name, I can use that tag name in
>>the integration scripts (e.g. to automatically add that tag name as a
>>new product version in Bugzilla). How can I capture tags ?
>>    
>>
>
>Tags don't exist in Subversion as first-class actions or items.  You
>get files and directories, and you get the ability to make copies of
>them.  That's branching and tagging.
>
That being said, if you followed the normal convention that tags always 
go in a /tags directory or something similar, you could (for example) 
have your hook scripts look for new directories within that directory.


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

Re: Subversion hooks

Posted by Kristis Makris <mk...@gmx.net>.
On Mon, 2004-07-26 at 00:34, Olaf Dietsche wrote:
> "C. Michael Pilato" <cm...@collab.net> writes:
> 
> > Use stderr.  In shell scripts, you can do this like:
> >
> >    echo "stdout redirected to stderr" 2>&1
> 
> I guess this should be:
>   echo "stdout redirected to stderr" >&2

I'm sorry. I still don't get any output on the console from this line
either.

Another question I have is how can I force subversion to use a different
log message template ? I'd like to bring one up which contains something
like:

Bug ID:
Log:

So the user will directly fill those in, rather than type them in each
time.


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

Re: Subversion hooks

Posted by Kristis Makris <mk...@gmx.net>.
> > I guess this should be:
> >   echo "stdout redirected to stderr" >&2
> 
> Doh!  You're right.
> 
> Still, I'm not sure if the client sees any error output unless the
> script returns failure (non-zero).  We didn't write the hook system to
> be a general purposes client feedback mechanism.

It appears that the client will only see error output if indeed the
script returns failure. I'm trying to display some status messages while
the integration commences. Something like:

Scmbug: Reading configuration
Scmbug: Submitting request
Scmbug: Request accepted

Since the integration I have transports an integration request to a
separate daemon, I'd like to display such messages while the integration
is carried out, to give the user some idea on what might be wrong with
the integration glue (e.g. if additional integration debugging flags are
turned on).

So, which files in the svn repository should I start looking at to
modify the hook system so it becomes a general purposes client feedback
mechanism ?

Thanks,
Kristis


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

Re: Subversion hooks

Posted by "C. Michael Pilato" <cm...@collab.net>.
Olaf Dietsche <ol...@olafdietsche.de> writes:

> "C. Michael Pilato" <cm...@collab.net> writes:
> 
> > Use stderr.  In shell scripts, you can do this like:
> >
> >    echo "stdout redirected to stderr" 2>&1
> 
> I guess this should be:
>   echo "stdout redirected to stderr" >&2

Doh!  You're right.

Still, I'm not sure if the client sees any error output unless the
script returns failure (non-zero).  We didn't write the hook system to
be a general purposes client feedback mechanism.

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

Re: Subversion hooks

Posted by Olaf Dietsche <ol...@olafdietsche.de>.
"C. Michael Pilato" <cm...@collab.net> writes:

> Use stderr.  In shell scripts, you can do this like:
>
>    echo "stdout redirected to stderr" 2>&1

I guess this should be:
  echo "stdout redirected to stderr" >&2

Regards, Olaf.

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

Re: Subversion hooks

Posted by "C. Michael Pilato" <cm...@collab.net>.
Kristis Makris <mk...@gmx.net> writes:

> I'm trying to implement integration of Subversion with Bugzilla, through
> Subversion's hooks mechanism. I noticed that when my hook scripts output
> something on stdout, these messages are not visible.
> How can I make error messages produced by the hook scripts visible to
> the user ?

Use stderr.  In shell scripts, you can do this like:

   echo "stdout redirected to stderr" 2>&1

> Also, I was unable to find how a tagging activity is flagged as such in
> a transaction. If I can capture a tag name, I can use that tag name in
> the integration scripts (e.g. to automatically add that tag name as a
> new product version in Bugzilla). How can I capture tags ?

Tags don't exist in Subversion as first-class actions or items.  You
get files and directories, and you get the ability to make copies of
them.  That's branching and tagging.  See chapter 4 of The Book
(http://www.svnbook.com).

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