Supporting configuration files in ~/.config/bazaar?

Eli Zaretskii eliz at gnu.org
Tue Nov 2 11:00:32 GMT 2010


> Date: Tue, 02 Nov 2010 00:13:57 -0500
> From: Neil Martinsen-Burrell <nmb at wartburg.edu>
> 
> I'm working on finishing off lp:~dobey/bzr/xdgconfigdir and bug #195397 
> (a fix has also been attempted in 
> lp:~j-johan-edwards/bzr/xdg_basedir_compliance) which deals with storing 
> configuration files in $XDG_CONFIG_DIR/bazaar on Unix (which is 
> ~/.config/bazaar by default).
> 
> I've outlined my thoughts in 
> http://bazaar.launchpad.net/~nmb/bzr/xdgconfigdir/annotate/head:/doc/developers/xdg_config_spec.txt 
> which are that we should essentially accept both ~/.bazaar and 
> ~/.config/bazaar for now, but tell users that we suggest they use 
> .config/bazaar (on Unix).  lp:~nmb/bzr/xdgconfigdir has my attempts at 
> fixing the bug.  I plan to use that branch to continue with fixing up 
> the docs, dealing with plugins and tests.
> 
> I post to the list because although there is some discussion on bug 
> #195397 about how and when we want to do this, I wanted to bring it up 
> to the list before I wade in and change all of the docs.

Thanks for bringing this up.  Please note that what's below is merely
a POV of a naive (albeit heavy) user of Bazaar on several machines and
OSes.

What bothers me in your suggestions is that bzr will annoy me.  I'm
quite sure it will also annoy others.  Why should a tool (and a nice
tool such as bzr) bitch at me for not being conformant to the hot new
whiz-bang standards someone invented?  A tool should _support_ new
standards, but it shouldn't _enforce_ them, IMO.

So I'd say adopt this part:

  * If both ~/.bazaar and $XDG_CONFIG_HOME/bazaar exist:

    - Use the config files in $XDG_CONFIG_HOME/bazaar with a warning that
      those in ~/.bazaar are being ignored.

and _only_ this part, and keep it forever, i.e. not just during the
"Transitional Phase".  A user who knows what she is doing (e.g.,
because she has multiple bzr versions installed, or for some other
good reason) will simply ignore the warning.  (Even better, it would
be nice to have a branch.conf option to silence the warning
completely.)  A user who forgot to move to the new brave world by
accident will notice the warning and clean up her act.  A user who
doesn't _want_ to go "back to the future" should be left to her own
devices, because what possible harm could be done by that?

> * Is this a change that Bazaar wants: ~/.bazaar -> ~/.config/bazaar?

I think Bazaar should want to support it.  But it doesn't need to
enforce such a migration.

> * Should plugins live in ~/.config/bazaar?  I believe that the answer is 
> yes.  This gives an easy transition from the current structure since "mv 
> ~/.bazaar ~/.config/bazaar" is all that is needed.  In terms of the XDG 
> basedir specification, I think that user-installed plugins are a form of 
> user customization and thus belong in $XDG_CONFIG_DIR.

I believe you meant either $XDG_CONFIG_HOME or $XDG_CONFIG_DIRS.

FWIW, I'm not sure that a plugin fits the "config" category.  It's not
a configuration file.  Don't they have $XDG_PLUGIN_HOME? ;-)

> * As a coding/layering issue, outputting a user-visible warning on every 
> call to bzrlib.config.config_dir() leads to very ugly output: 5 or more 
> messages for each command.  Is there an easy way to output a message 
> only once?

Just don't warn at all.  It's an annoyance that users don't deserve.



More information about the bazaar mailing list