You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by km...@rockwellcollins.com on 2008/03/19 19:53:21 UTC

Modifying log message in pre-commit hook

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?

Kevin R.

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

Re: Modifying log message in pre-commit hook

Posted by Matt imMute Sickler <im...@msk4.ath.cx>.
kmradke@rockwellcollins.com wrote:
> 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?
> 
> Kevin R.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
svn propget PROPNAME --revprop -r REV [URL]
svn propset PROPNAME --revprop -r REV [PROPVAL | -F VALFILE] [TARGET]

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

Re: Modifying log message in pre-commit hook

Posted by km...@rockwellcollins.com.
"Andy Levy" <an...@gmail.com> wrote on 03/20/2008 10:33:00 AM:
> On Thu, Mar 20, 2008 at 11:30 AM,  <km...@rockwellcollins.com> wrote:
> > Karl Fogel <kf...@red-bean.com> wrote on 03/20/2008 12:35:43 AM:
> >
> > > kmradke@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.

Re: Modifying log message in pre-commit hook

Posted by Karl Fogel <kf...@red-bean.com>.
"Andy Levy" <an...@gmail.com> writes:
>>  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?

I don't think that's an issue.  If the commit fails, then the entire txn
goes away and those systems never see the new revision (because there is
no new revision), and the post-commit hook is never run.

Kevin's point is that he wants the log message to be in its final form
by the time the commit is finalized, *if* it's going to be finalized.
Tweaking it after the fact is less useful to him.

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

Re: Modifying log message in pre-commit hook

Posted by Andy Levy <an...@gmail.com>.
On Thu, Mar 20, 2008 at 11:30 AM,  <km...@rockwellcollins.com> wrote:
> Karl Fogel <kf...@red-bean.com> wrote on 03/20/2008 12:35:43 AM:
>
> > kmradke@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?

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

Re: Modifying log message in pre-commit hook

Posted by km...@rockwellcollins.com.
Karl Fogel <kf...@red-bean.com> wrote on 03/20/2008 12:35:43 AM:
> kmradke@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.

> As far as I know, the cmdline programs (well, svnadmin) shipped with svn
> don't give you a way to edit txn properties.  But you could "pretty
> easily" write a program to do it using one of the bindings sets (say,
> the Python bindings).  I'm actually kind of in favor of 'svnadmin
> setlog' taking a -t txn argument, but that's certainly not going to
> happen for the 1.5 release.

Yes, this was my real question.  Should we create an enhancement
request to allow "svnadmin setlog -t txn"?

I wasn't really expecting anything for 1.5...

Since I finally bit the bullet and now have functional python bindings
using the API directly is now a possibility as well.

Kevin R.


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

Re: Modifying log message in pre-commit hook

Posted by Karl Fogel <kf...@red-bean.com>.
kmradke@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...

As far as I know, the cmdline programs (well, svnadmin) shipped with svn
don't give you a way to edit txn properties.  But you could "pretty
easily" write a program to do it using one of the bindings sets (say,
the Python bindings).  I'm actually kind of in favor of 'svnadmin
setlog' taking a -t txn argument, but that's certainly not going to
happen for the 1.5 release.

-Karl


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

Re: Modifying log message in pre-commit hook

Posted by prakash tiwary <pr...@gmail.com>.
Hi,
I think,You can use post commit hook from there you can can call "svn
propset " to modify the log message in certain format.

For example:
svn propset -r * revision no*  --revprop svn:log new message  *URL*

For further informations:
http://subversion.tigris.org/faq.html#change-log-msg

I wish it will help you.

Thanks & Regards
Prakash

On Thu, Mar 20, 2008 at 1:23 AM, <km...@rockwellcollins.com> wrote:

> 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?
>
> Kevin R.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>