Supporting configuration files in ~/.config/bazaar?

Neil Martinsen-Burrell nmb at wartburg.edu
Tue Nov 2 05:13:57 GMT 2010


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.

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

* 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.  (My in-progress 
branch does not change the plugin location away from ~/.bazaar.)

* As a related but orthogonal change, should Mac OS X move to storing 
its configuration in ~/Library/Application Support/Bazaar which would in 
some sense be the platform-appropriate place?  Or pretend to be a Unix 
and use ~/.config/bazaar?  In my branch, I've preserved the existing 
location (~/.bazaar) on Mac OS X.

* 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?  I could see how to do this at the command level, but 
config_dir() has no sense of context and I'm not sure what the right way 
to add that context is.  Warn once per day?  Write a semaphore file 
somewhere in the configuration directory?  I suspect that if I were 
truly a software developer then I would know the right way to do this, 
but alas I am not.

-Neil



More information about the bazaar mailing list