git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: git cvsimport and case-insensitive config
Date: Tue, 30 Mar 2010 20:05:57 +0200	[thread overview]
Message-ID: <cb7bb73a1003301105v691624sdcdadf6809c50b89@mail.gmail.com> (raw)
In-Reply-To: <7vy6h9vhuk.fsf@alter.siamese.dyndns.org>

On Tue, Mar 30, 2010 at 7:29 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
>
>> git cvsimport looks for cvsimport.* single-letter keys that match the
>> command-line option (e.g. cvsimport.r for -r). However, since there are some
>> single-letter options which only differ by case (a vs A, r vs R) if you set
>> either you get annoying messages (and potentially also odd results, although
>> I haven't come across these yet).
>
> Ouch.
>
> The only sensible solution in the longer term is to eventually rename them
> to spell them out e.g. cvsimport.remote vs cvsimport.userevisionmap.
>
> The transition cost would be the same for either approach.
>
>  (1) Introduce long options for cvsimport; the code already uses
>     Getopt::Long, so this shouldn't be too bad.
>
>  (2) Add case-sensitive variant of "git config -l" that shows the config
>     variable names in the original case.
>
>  (3) Upon startup, use "git config -l -f $GIT_DIR/config" to check for
>     historical short name (e.g. "cvsimport.a" or "cvsimport.A").  If
>     there are, map them to longer name, remove the short keys and write
>     the conversion back to the configuration file.  You might want to do
>     the same for "$HOME/.gitconfig" as well.
>
>  (4) Then the rest of the code can stay the same.

We might be able to skip (2) by relying on the fact that if the
lowercase is boolean, the uppercase isn't, and conversely. So when
upgrading we check first for the boolean case, if we get a failure (as
opposed to no value) then we know it's the non-boolean one. Then we
can migrate the values accordingly.

-- 
Giuseppe "Oblomov" Bilotta

  reply	other threads:[~2010-03-30 18:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30  8:32 git cvsimport and case-insensitive config Giuseppe Bilotta
2010-03-30 17:29 ` Junio C Hamano
2010-03-30 18:05   ` Giuseppe Bilotta [this message]
2010-03-30 21:20     ` Junio C Hamano
2010-03-30 22:17       ` Giuseppe Bilotta
2010-03-30 23:14         ` Junio C Hamano
2010-03-31  6:54           ` Giuseppe Bilotta
2010-03-31  9:45             ` Junio C Hamano
2010-03-31 11:17               ` Giuseppe Bilotta

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=cb7bb73a1003301105v691624sdcdadf6809c50b89@mail.gmail.com \
    --to=giuseppe.bilotta@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).