Supporting configuration files in ~/.config/bazaar?

Neil Martinsen-Burrell nmb at wartburg.edu
Mon Nov 15 16:45:59 GMT 2010


On 2010-11-14 21:55 , Martin Pool wrote:
> On 2 November 2010 22:00, Eli Zaretskii<eliz at gnu.org>  wrote:

[...]

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

This is what I have implemented in
https://code.launchpad.net/~nmb/bzr/xdgconfigdir/+merge/40888,
with no user-visible warning. The warning goes into ~/.bzr.log.

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

I have punted on this, suggesting in doc/developers/xdg_spec.txt that 
people can use BZR_PLUGINS_PATH if they would like something different.

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

As mentioned above, the fact that we are not using ~/.bazaar is 
mentioned in ~/.bzr.log, not in any user-visible way.

-Neil



More information about the bazaar mailing list