You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Harvey, Edward" <Ed...@patni.com> on 2007/11/09 16:50:33 UTC

Svn log inside a post-commit hook

Hey all.

I like the output of svn log:
	[eharvey@localhost]$ svn log -r 207 --verbose
http://svnhost/repositories/myrepo
	
------------------------------------------------------------------------
	r207 | eharvey | 2007-11-09 11:36:26 -0500 (Fri, 09 Nov 2007) |
1 line
	Changed paths:
	   M /trash/trash.txt
	   M /trash.txt
	
	here is my comment
	
------------------------------------------------------------------------

But when I try to write "svn log" into a post-commit hook, it appears it
can't perform that operation.  Svnlook works, but is there any
(relatively easy) way to get output like the above using svnlook?  Or
any way to make svn log work inside a post-commit hook?

Thanks...

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


Re: Svn log inside a post-commit hook

Posted by Hari Kodungallur <hk...@gmail.com>.
On Nov 9, 2007 8:58 AM, Andy Levy <an...@gmail.com> wrote:

> On 11/9/07, Harvey, Edward <Ed...@patni.com> wrote:
> > Hey all.
> >
> > I like the output of svn log:
> >         [eharvey@localhost]$ svn log -r 207 --verbose
> > http://svnhost/repositories/myrepo
> >
> > ------------------------------------------------------------------------
> >         r207 | eharvey | 2007-11-09 11:36:26 -0500 (Fri, 09 Nov 2007) |
> > 1 line
> >         Changed paths:
> >            M /trash/trash.txt
> >            M /trash.txt
> >
> >         here is my comment
> >
> > ------------------------------------------------------------------------
> >
> > But when I try to write "svn log" into a post-commit hook, it appears it
> > can't perform that operation.  Svnlook works, but is there any
> > (relatively easy) way to get output like the above using svnlook?  Or
> > any way to make svn log work inside a post-commit hook?
>
> Have you tried svnlook log?


Andy, 'svnlook log' only prints out the commit log message. It does not
print all the details  like 'svn log'. The author / commit time / changed
files etc are all separate commands for svnlook.

Edward, what you could do is to have a line like this in the post-commit
hook:

    /usr/local/bin/svn log -r $REV "file://$REPOS" > /tmp/mylog

This should work.
[Of course the path to svn may be different for you. And $REV and $REPOS are
second and first params to the hook respectively].


Having said that in case you are using the log output to parse the details,
then you might just want to use separate svnlook commands to get all the
info.

Regards,
-Hari Kodungallur

Re: Svn log inside a post-commit hook

Posted by Andy Levy <an...@gmail.com>.
On 11/9/07, Harvey, Edward <Ed...@patni.com> wrote:
> Hey all.
>
> I like the output of svn log:
>         [eharvey@localhost]$ svn log -r 207 --verbose
> http://svnhost/repositories/myrepo
>
> ------------------------------------------------------------------------
>         r207 | eharvey | 2007-11-09 11:36:26 -0500 (Fri, 09 Nov 2007) |
> 1 line
>         Changed paths:
>            M /trash/trash.txt
>            M /trash.txt
>
>         here is my comment
>
> ------------------------------------------------------------------------
>
> But when I try to write "svn log" into a post-commit hook, it appears it
> can't perform that operation.  Svnlook works, but is there any
> (relatively easy) way to get output like the above using svnlook?  Or
> any way to make svn log work inside a post-commit hook?

Have you tried svnlook log?

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