mbp at sourcefrog.net
Sat Jan 24 15:38:53 GMT 2009
2009/1/24 John Carr <john.carr at unrouted.co.uk>:
> Any feedback on this? I'm faking Branch.hooks calls out of process (by
> scanning the branch for changes since the last run) - is this a bad
> thing? Should i provide my own hooks instead? If i do that, any ideas
> on how plugins like bzr-cia can work with both sets of hooks without
> lots of duplicated effort between each hook plugin?
> My branch at lp:~johncarr/+junk/bzr-watcher grew a bit more in the
> meantime (added a watch command, added inotify back in).
I haven't read (I can if you want) or tried the code yet but it sounds
like a pretty good idea.
Particularly if this can watch for inotify, it might be interesting to
run even on a laptop to eg generate cia or direct-to-irc
notifications, or to asynchronously push your work to a server to make
sure it's backed up.
I would say, ideally, one would be able to move a hook from being run
synchronously on commit to being run asynchronously by bzr-watch by
just changing one line in the configuration.
I would think that you should probably provide distinct hooks, and
then have a way to redirect the registration of that plugin to go into
your hook instead. I think then you should generate your own relevant
Result object and pass that to all your hooks. But this is not a firm
opinion; it depends on how it actually looks in the code.
On a bit of a tangent, I'm interested in why you put this in +junk and
not in a newly registered bzr-watch project. I'm guessing that's
because it's still experimental and you either weren't sure it
deserved to be so visible as a project would make it and/or you
thought making a project would take more effort than was worthwhile?
Many branches seem to start out in +junk and I wonder if lp should
change how it handles this.
More information about the bazaar