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

Re: Modifying log message in pre-commit hook

From: <kmradke_at_rockwellcollins.com>
Date: Thu, 20 Mar 2008 10:46:48 -0500

"Andy Levy" <andy.levy_at_gmail.com> wrote on 03/20/2008 10:33:00 AM:
> On Thu, Mar 20, 2008 at 11:30 AM, <kmradke_at_rockwellcollins.com> wrote:
> > Karl Fogel <kfogel_at_red-bean.com> wrote on 03/20/2008 12:35:43 AM:
> >
> > > kmradke_at_rockwellcollins.com writes:
> > > > I would like to expand an user entered BUGID in the log message
in the
> > > > pre-commit hook (I.E. add missing zeros at the beginning of the
> > > > number). I have the new value and the old log message, I just
> > > > do not know how to apply the changes to the transaction in the
hook.
> > > >
> > > > svnadmin setlog does not take a transaction argument. Should it?
> > > >
> > > > svn propset/propedit do not take transaction arguments. (I'm ok
with
> > this
> > > > since I would rather use the specific svnadmin setlog.)
> > > >
> > > > The pre-commit.tmpl file seems to indicate changing revision
> > properties
> > > > such as svn:log is ok, but there doesn't seem to be an easy way
to do
> > it
> > > > without using either the perl or python API directly.
> > > >
> > > > It is possible to rewrite the log message in the post-commit
hook, but
> > > > doing it there would significantly complicate other hooks for
non-SVN
> > > > related reasons.
> > > >
> > > > Thoughts?
> > >
> > > Yes, you could do it in the post-commit hook...
> >
> > Yep. That unfortunately complicates matters because the pre-commit
> > hook needs to duplicate the log message in other systems.
>
> What if the commit fails? Should that log message still be put into
> those other systems?

There are alot of ugly (non-SVN) related details that complicate this. It
is actually a chicken and an egg problem since the other systems also
have to "allow" the checkin to proceed (hence the use of the pre-commit
hook).

Integrating systems cause a lot of corner conditions. I was purposely
being
vague since most of the details do not relate to svn at all. I can (and
probably will) rewrite the log message in the post-commit hook, also
updating
the other systems. This will make the already overly complex hooks
scripts
a little more complex, but they are already doing similar things, so it
won't
be a big issue.

I still think it would be nice to be able to use the cmd line tools to
rewrite a log message in the pre-commit hook. I'll add this to my
list of things to attempt to write a patch for and hope someone beats
me to it...

Kevin R.
Received on 2008-03-20 16:47:14 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.