Supporting configuration files in ~/.config/bazaar?

Martin Pool mbp at canonical.com
Mon Nov 15 03:55:48 GMT 2010


On 2 November 2010 22:00, Eli Zaretskii <eliz at gnu.org> wrote:
>> 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.

I agree with what Eli said above.  Note that, unlike the earlier
proposal, this is checking specifically for the 'bazaar' directory
within it.

>
>> * 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? ;-)

I agree, it seems questionable to put what may be platform-specific
binaries in there.

>> * 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.

Right, this is something very few users would thank us for warning
them about.  Anyone who feels strongly about XDG compliance will
probably have set things up that way themselves, and will be happy if
we just read it.

-- 
Martin



More information about the bazaar mailing list