[RFC] Better hooks for Bazaar

Andrew Bennetts andrew at canonical.com
Tue Dec 18 00:17:18 GMT 2007


Jelmer Vernooij wrote:
> Am Montag, den 17.12.2007, 23:35 +1000 schrieb Ian Clatworthy:
[...]
> > * Did you prefer hooks in other systems and why? Was it the available
> >   hooks, how they were configured or both?
> Being able to set server side hooks would be nice (post-push-hooks or
> something). If I have a shared branch that I work on with several
> people, it's nice if we only have to configure the hooks once for our
> shared branch (or shared repository we all own branches in) rather than
> having all contributors configure a post-commit hook on their local
> machine.

We almost have this.

We have:

  * a “set_rh” (set revision history) branch hook
  * a “Branch.set_last_revision” HPSS request method, which would run any
    “set_rh” hooks.

What's missing is that when a branch is pushed over the smart protocol, for some
reason the client never makes a Branch.set_last_revision smart request.  Looking
at the -Dhpss output, it appears it just uploads the revision-history file or
whatever directly by VFS requests.

So if someone can teach the client to just call that method rather than (or even
in addition to) pushing the underlying format files, then we'll have server-side
hooks.

The other thing that would be needed to make server-side hooks really useful is
a way to specify global configuration that a bzr+ssh process will read, so that
people using bzr+ssh will have their server-side bzr process use the hooks.  I
suspect there's overlap here with the access control thread from a week or so
ago.

-Andrew.




More information about the bazaar mailing list