Re: git cvsimport and case-insensitive config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 30, 2010 at 7:29 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Giuseppe Bilotta <giuseppe.bilotta@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]