git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git cvsimport and case-insensitive config

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Mar 30, 2010, 18:05 UTC
Message-ID
<cb7bb73a1003301105v691624sdcdadf6809c50b89@mail.gmail.com>
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:
Show 28 quoted lines
> 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 9 in “git cvsimport and case-insensitive config”
  1. Giuseppe BilottaMar 30, 2010
  2. Junio C HamanoMar 30, 2010
  3. Giuseppe BilottaMar 30, 2010
  4. Junio C HamanoMar 30, 2010
  5. Giuseppe BilottaMar 30, 2010
  6. Junio C HamanoMar 30, 2010
  7. Giuseppe BilottaMar 31, 2010
  8. Junio C HamanoMar 31, 2010
  9. Giuseppe BilottaMar 31, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.