All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/3] cvsimport: fix the parsing of uppercase config options
Date: Sun, 28 Nov 2010 20:30:17 +0100	[thread overview]
Message-ID: <4CF2ADC9.8020504@drmicha.warpmail.net> (raw)
In-Reply-To: <7vwrnznueh.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 27.11.2010 07:38:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> The current code leads to
>>
>> fatal: bad config value for 'cvsimport.r' in .git/config
>>
>> for a standard use case with cvsimport.r set:
>>
>> cvsimport sets internal variables by checking the config for each
>> possible command line option. The problem is that config items are case
>> insensitive, so config.r and config.R are the same. The ugly error is
>> due to that fact that cvsimport expects a bool for -R (and thus
>> config.R) but a remote name for -r (and thus config.r).
>>
>> Fix this by making cvsimport expect the config item "cvsimport.RR"
>> for the command line option "-R" etc.
> 
> I do not think this is "fixing" per-se.  Isn't it more like "We didn't
> have a way to use the configuration file to specify uppercase option; now
> we do thanks to this patch, and here is how"?

It is a fix because the the existing code base checks for "cvsimport.r"
in order to set "opt_r" and for "cvsimport.R" in order to set "opt_R"
(etc). That is, it sets "opt_R" from a config variable which should have
nothing to do with it (cvsimport.r=cvsimport.R).

In the case when R expects a boolean you'll notice because "config get
--bool" will die, but if both "x" and "X" expect the same type then you
set defaults for "opt_x" and "opt_X" from the single "cvsimport.x".

> And the "here is how" workaround, while it may be a reasonable way out, is
> so obscure that it needs to be documented, no?  Ahh, that is what [3/3] is.

Yes, 3/3. Should I squash this with 2?

> The $ckey change from 1/3 needs to be done here, I think.

Yes, sorry, this was an "add -p" related oversight on my side. I'll resend.

Michael

  reply	other threads:[~2010-11-28 19:29 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25 15:10 [PATCH 1/3] cvsimport: partial whitespace cleanup Michael J Gruber
2010-11-25 15:10 ` [PATCH 2/3] cvsimport: fix the parsing of uppercase config options Michael J Gruber
2010-11-27  6:38   ` Junio C Hamano
2010-11-28 19:30     ` Michael J Gruber [this message]
2010-11-28 19:39       ` [PATCHv2 1/3] cvsimport: partial whitespace cleanup Michael J Gruber
2010-11-28 19:39         ` [PATCHv2 2/3] cvsimport: fix the parsing of uppercase config options Michael J Gruber
2010-11-28 19:39         ` [PATCHv2 3/3] cvsimport.txt: document the mapping between config and options Michael J Gruber
2010-11-29 20:23           ` Junio C Hamano
2010-11-30  7:56             ` Michael J Gruber
2010-12-01  1:43               ` Junio C Hamano
2010-12-01 12:53                 ` [PATCHv3 0/3] uppercase config options for cvsimport Michael J Gruber
2010-12-01 12:53                   ` [PATCHv3 1/3] cvsimport: partial whitespace cleanup Michael J Gruber
2010-12-01 12:53                   ` [PATCHv3 2/3] cvsimport: fix the parsing of uppercase config options Michael J Gruber
2010-12-01 14:59                     ` Martin Langhoff
2010-12-01 16:05                       ` Jonathan Nieder
2010-12-01 16:18                         ` Martin Langhoff
2010-12-01 16:23                         ` Jakub Narebski
2010-12-01 16:34                           ` Jonathan Nieder
2010-12-01 16:52                             ` Michael J Gruber
2010-12-01 17:01                               ` Jonathan Nieder
2010-12-01 17:58                               ` Jeff King
2010-12-01 19:47                                 ` Junio C Hamano
2010-12-02 21:46                                   ` Junio C Hamano
2010-12-01 17:55                             ` Jeff King
2010-12-01 18:36                               ` [PATCH] add: introduce add.ignoreerrors synonym for add.ignore-errors Jonathan Nieder
2010-12-01 18:46                                 ` Jeff King
2010-12-01 18:57                                   ` Jonathan Nieder
2010-12-01 19:56                                     ` Junio C Hamano
2010-12-01 20:09                                     ` Junio C Hamano
2010-12-01 21:07                                       ` Jeff King
2010-12-03  2:18                                       ` Junio C Hamano
2010-12-01 12:53                   ` [PATCHv3 3/3] cvsimport.txt: document the mapping between config and options Michael J Gruber
2010-12-01 15:02                 ` [PATCHv2 " Martin Langhoff
2010-12-01 15:34                   ` Michael J Gruber
2010-11-25 15:10 ` [PATCH " Michael J Gruber
2010-11-27  6:33 ` [PATCH 1/3] cvsimport: partial whitespace cleanup Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CF2ADC9.8020504@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.