Discussed changes
Gustavo Niemeyer
gustavo at niemeyer.net
Thu Aug 18 14:57:34 BST 2005
Hey John,
[...]
> My suggestion is to have BZR_PLUGIN_PATH act more like the real path,
> where the first entry found is used, and all others are ignored. The
> warning was more of a debugging thing so that people would understand
> why their plugin may not be loaded.
> And then I would have BZR_PLUGIN_PATH changed so that the default path
> is "~/.bzr.conf/plugins:$BZRLIB/plugins"
>
> So that by default personal plugins take precedence, and then site-wide
> plugins. And if someone wants to change what gets loaded, they can just
> use the environment variable.
My first impression is that this sounds a bit unusual for a plugin
infrastructure. In other plugin systems I can think about right now
plugin names are not usually important. What I wonder is: wouldn't a
user be surprised if he introduced something which coincidently had
the same name as a plugin which is in the system-wide directory, and
the functionality provided by that last one disappeared?
What about Aaron's suggestion, of handling these issues where
really necessary? For instance, it's perfectly ok that two plugins
with the same name are loaded. What is not ok is having two identic
commands, so the register_command() function could simply use the
last defined one.
> I would also consider getting rid of the automatic nature of plugins,
> and switch to using a dictionary of command-name => function.
Having a different command infrastructure seems interesting indeed.
> I was realizing that if you use plugins to implement hooks, you might
> want multiple levels. So each level could grab the old "commit"
> function, replace it with it's own function, and then call the original.
> This would let you chain multiple overloads. Right now we really only
> support 1 overload.
Right. That's another reason why I belive that plugins' filenames
shouldn't be considered. OTOH, if the command infrastructure uses the
file name to define the command name, which is very interesting since
that's the *only* command module it should import, having meaningful
file names sounds nice.
Best regards,
--
Gustavo Niemeyer
http://niemeyer.net
More information about the bazaar
mailing list