[RFC] support for plugins to implement their own log formatters
Erik Bågfors
zindar at gmail.com
Fri Feb 3 21:38:13 GMT 2006
2006/2/3, Aaron Bentley <aaron.bentley at utoronto.ca>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Erik Bågfors wrote:
> > in log.py, created "register_formatter" and "set_default_formatter"
> > that plugins can use to do register and change the default. Changed
> > how default formatter was choosen. This all felt like no-brainers...
>
> I don't know about set_default_formatter. AFICT, its purpose is to
> allow plugins to control the setting, but a user may have a plugin
> installed without wanting to change their default.
Agreed. That was something I was unsure about as well (but forgot
when I wrote the mail)
Shall I remove it? I'm fine with that.
> Are you doing this because you're concerned about having to set the
> defaults separately for each command that uses log formatters? I
> certainly don't have a problem with a global log-formatter-default option.
Sounds good. I wasn't thinking about the default thing since that's
not in bzr.dev yet afaik...
I'll see if I can get the log-formatter thing into this as well.
> > I also added another command line option to select with formatter to
> > use. I called it "log-format" for now. So you can use "bzr log
> > --log-format short" to do the same thing as "bzr log --short".
> > --short is still supported. Now a new plugin can register a formatter
> > "foo" and you can use "--log-format foo" to use it.
> >
> > I'm not 100% happy about this command line option, but at least it
> > works as expected. You now have both --long, --line, --short, and
> > --log-format ARG. That's not really good.
>
> This goes back to my earlier post about how we should support
> enumeration command-line options. (which you already knew from IRC)
Yes, I'll leave it the way it is for now.
would also be fun if plugins could extend the command-line options a
command can except....
> It looks like you haven't covered all the commands that use log
> formatters in this patch.
>
You're right. The only one I could find was missing. I fixed that and
pushed a new revision....
/Erik
More information about the bazaar
mailing list