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

Re: [PATCH 2/3] cvsimport: fix the parsing of uppercase config options

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Nov 28, 2010, 19:30 UTC
Message-ID
<4CF2ADC9.8020504@drmicha.warpmail.net>
In-Reply-To
<7vwrnznueh.fsf@alter.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 27.11.2010 07:38:
Show 20 quoted lines
> 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
Previous: Junio C HamanoNext: Michael J Gruber
Message 4 of 36 in “cvsimport: partial whitespace cleanup”
  1. 1/3 cvsimport: partial whitespace cleanupMichael J Gruber, Nov 25, 2010
  2. 2/3 cvsimport: fix the parsing of uppercase config optionsMichael J Gruber, Nov 25, 2010
  3. Junio C HamanoNov 27, 2010
  4. Michael J GruberNov 28, 2010
  5. 1/3 cvsimport: partial whitespace cleanupMichael J Gruber, Nov 28, 2010
  6. 2/3 cvsimport: fix the parsing of uppercase config optionsMichael J Gruber, Nov 28, 2010
  7. 3/3 cvsimport.txt: document the mapping between config and optionsMichael J Gruber, Nov 28, 2010
  8. Junio C HamanoNov 29, 2010
  9. Michael J GruberNov 30, 2010
  10. Junio C HamanoDec 1, 2010
  11. 0/3 uppercase config options for cvsimportMichael J Gruber, Dec 1, 2010
  12. 1/3 cvsimport: partial whitespace cleanupMichael J Gruber, Dec 1, 2010
  13. 2/3 cvsimport: fix the parsing of uppercase config optionsMichael J Gruber, Dec 1, 2010
  14. Martin LanghoffDec 1, 2010
  15. Jonathan NiederDec 1, 2010
  16. Martin LanghoffDec 1, 2010
  17. Jakub NarebskiDec 1, 2010
  18. Jonathan NiederDec 1, 2010
  19. Michael J GruberDec 1, 2010
  20. Jonathan NiederDec 1, 2010
  21. Jeff KingDec 1, 2010
  22. Junio C HamanoDec 1, 2010
  23. Junio C HamanoDec 2, 2010
  24. Jeff KingDec 1, 2010
  25. add: introduce add.ignoreerrors synonym for add.ignore-errorsJonathan Nieder, Dec 1, 2010
  26. Jeff KingDec 1, 2010
  27. Jonathan NiederDec 1, 2010
  28. Junio C HamanoDec 1, 2010
  29. Junio C HamanoDec 1, 2010
  30. Jeff KingDec 1, 2010
  31. Junio C HamanoDec 3, 2010
  32. 3/3 cvsimport.txt: document the mapping between config and optionsMichael J Gruber, Dec 1, 2010
  33. Martin LanghoffDec 1, 2010
  34. Michael J GruberDec 1, 2010
  35. 3/3 cvsimport.txt: document the mapping between config and optionsMichael J Gruber, Nov 25, 2010
  36. Junio C HamanoNov 27, 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.