[Svnmerge] [PATCH] Read command line defaults from config file

Giovanni Bajo rasky at develer.com
Thu Sep 21 10:56:00 PDT 2006


Rich Williams wrote:

>> For boolean options, this might imply that you need inverse options
>> to
>> be able to override options set in the config file.  For example, if
>> the config file lists "--show-changes", it would be useful to be
>> able to specify "--no-show-changes" on the command line.
>
> That sounds like an idea, but I'm a little worried about how
> complicated
> it might get. I guess also, some options will never make sense in a
> config file (-r ?), so perhaps the logic needs to get a lot smarter.
> Hmph. Not sure my Python skills are up to that just yet, I'll have a
> go.

OK, but note that this is absolutely orthogonal with your change. Adding
support for --no-* version of boolean options has absolutely nothing to do
with adding support for the configuration file. I'm fine with the --no-*
idea, but it should be pursued at the OptionParser-level, and in another
patch-

>> Better would be if you could override the config file via the command
>> line, using an option like "--no-config" or "--config-dir=BLAH" (the
>> latter option is available in svn).  That would be useful to users
>> who
>> have multiple "environments" and would also help with testing--tests
>> could specify their own config files to test the config file feature
>> itself.
>
> I think that's a really good idea, and I'll try and put something
> like that in the next version of the patch.

I don't specifically like a command line option to disable configuration
parsing, because it would require something like a double-parsing of the
options (first you parse the command line, then, if --no-config was NOT
specified, parse it again but this time together with the options on the
config file). Also, specifying --no-config in the config file will be a nice
headache. If we really want this feature available, I think it's better to
use an environment variable:

$ SVNMERGE_CONFIG=0 svnmerge.py [...]
-- 
Giovanni Bajo




More information about the Svnmerge mailing list