Lazily registering hooks?

Jelmer Vernooij jelmer at debian.org
Mon May 31 00:12:59 BST 2010


On Mon, May 31, 2010 at 11:01:11AM +1200, Robert Collins wrote:
> On Mon, May 31, 2010 at 8:39 AM, Jelmer Vernooij <jelmer at debian.org> wrote:
> > On Mon, 2010-05-31 at 07:59 +1200, Robert Collins wrote:
> >> And finally, when using this api, you'd get called immediately for
> >> already-present hooks, so you wouldn't need to care about what order
> >> things happen in.
> > The major disadvantage of that approach though is that that means every
> > single plugin needs more plumbing to deal with hook registration.
> Thats not true. Plugins that deal with rarely loaded hook points need
> more plumbing (and you can imagine sugar on top of it to allow totally
> declarative usage), but most plugins don't hook into all the odd
> little corners, and thus don't need any changes at all.
So you're suggesting taking a different approach for different hooks, 
depending on where they live ? It would affect fewer plugins in that case, but
it would be nice to have a consistent way of dealing with hooks.

Cheers,

Jelmer



More information about the bazaar mailing list