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

Client-side commit hooks (Revisited)

From: Peter Davis <peter_at_pdavis.cx>
Date: 2002-08-02 21:41:37 CEST

This issue has come up before, but in a different context. Skip to the end to
read my real issue if you don't want to read the long and boring context.

For those who don't know, I'm starting a project called Subissue
(subissue.tigris.org) that aims to implement issue tracking directly in a
subversion repository. All was well until I talked to Sergey Lipnevich.

He suggested analyzing log messages from all commits and updating issues based
on commands embedded in the log messages. For example, you could have a
message like:

  Subissue: /issues/assigned/your-username/issue-314159
  Subissue-Status: Resolved
  Subissue-Resolution: Fixed
  Fixed the fubar in baz.c; the whatzit was messing up the hoozer.

Subissue would provide some kind of commit hook to look at the message and
update the issues accordingly. This works fine in Sergey's original
idea/project, which is a commit hook that updates a Bugzilla database.

My project needs to update files in the same repository as what is being
committed (since the issues are stored in the repository). This means I
can't just write a pre-commit hook, since Subversion's hooks cannot modify
the transaction (which is a Good Thing).

The alternative is to design this part of Subissue as a wrapper around the svn
binary, but the wrapper would have to basically understand the semantics of
each command, and other clients (RapidSVN) couldn't benefit from the wrapper.
Hairy.

** Begin reading here **

Another thread back on May 25 talked about adding client-side commit hooks,
and it was brushed off as being a security hazard (since the hooks were
configured and stored in the repository). Well, what if the hooks were
simply specified by command line options, or in the user's ~/.subversion/
configuration?

$ svn ci -m "Log" --pre-commit-hook=/path/to/subissue-pch

(The --pre-commit-hook option could be remembered with 'alias svn=svn
--pre-commit-hook...' or in ~/.subversion/.)

Now, hooks as we have known them have so far have mostly been geared towards
performing passive actions w.r.t. the repository. To properly do what I want
to do, the transaction needs to be ammended with additional files and
modifications. So, does anyone have any ideas on how this could be done?

Is this type of hook the right answer? Would it be better/easier to add hooks
directly to the client library?

-- 
Peter Davis
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 2 21:42:16 2002

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

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