[MERGE] Allow self documenting hooks.

Andrew Bennetts andrew.bennetts at canonical.com
Tue Mar 10 04:23:35 GMT 2009


Martin Pool wrote:
> 2009/3/10 Robert Collins <robert.collins at canonical.com>:
> > On Tue, 2009-03-10 at 11:54 +1000, Martin Pool wrote:
> >> +    * Hooks can now be self documenting. ``bzrlib.hooks.Hooks.create_hook``
> >> +      is the entry point for this feature. (Robert Collins)
> >>
> >> Having different classes called Foo and Foos is a bad idea because it
> >> makes it hard to talk about the two of them precisely.  That's
> >> probably better handled by renaming Hooks to HookSet or something.
> >
> > Or we could call Hook Hookable or something like that.
> 
> HookPoint, because it makes it clearer it's the place they're hung
> from, not the things that are called?

I found this ambiguity to be painful when writing some documentation about
hooks.  I ended up using the term “hook function” to distinguish the things
that are called from other things, which isn't very satisfying.  So I'd be
happy to see the term “hook point” introduced for this concept.

If we do adopt a new term, it would be good to update the documentation to
use it, but that doesn't have to block this patch of course.

-Andrew.




More information about the bazaar mailing list