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

Re: fast-import should not care about core.ignorecase

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 9, 2014, 20:19 UTC
Message-ID
<xmqqoarclgnr.fsf@gitster.dls.corp.google.com>
In-Reply-To
<54866A94.2040305@workspacewhiz.com>
Joshua Jensen <jjensen@workspacewhiz.com> writes:
Show 17 quoted lines
> Jonathan Nieder wrote on 12/8/2014 6:31 PM:
>> Joshua Jensen wrote:
>>> I think it has been discussed before, but maybe Git needs a
>>> core.casefold in addition to core.ignorecase.)
>> Would it work for --casefold to be a commandline flag to fast-import,
>> instead of a global option affecting multiple Git commands?
> Given that core.ignorecase=true means to fold filename case in quite a
> number of places within Git right now, I would expect the same
> behavior within a repository where fast-import is being run against
> core.ignorecase=true.
>
> So, I don't know what core.ignorecase should mean, but I'm pretty sure
> I know what core.foldcase should mean.
>
> Would --casefold work?  Sure, but it would be a special case against
> the existing core.ignorecase behavior that I don't think makes much
> sense.
I would recommend doing this:
 - Add file-scope static variable fast_import_casefold to fast-import.c
 - Patch fast-import.c where it calls strncmp_icase(a, b) to read
    fast_import_casefold ? strcasecmp(a, b) : strcmp(a, b);
 - Initialize fast_import_casefold to the same value as ignore_case.
 - Add a new command line option "--[no-]casefold" to modify the
   value of fast_import_casefold.
Once all of the above is in place, optionally do this:
 - Add fastImport.casefold configuration variable.  The
   initialization logic for fast_import_casefold would then become:
    1. If the configuration is set, use that value; otherwise
    2. Use the same value as ignore_case.
 - Start warning when fast_import_casefold is set to true only
   because ignore_case is set (i.e. no "--[no-casefold]" is given
   from the command line or from the config), saying that this is
   true for now only as a backward compatibility measure and in a
   later version of Git we will flip the default _not_ to fold on
   any system.
 - Wait a bit and then flip the default.
Previous: Joshua JensenNext: Mike Hommey
Message 6 of 12 in “fast-import should not care about core.ignorecase”
  1. Mike HommeyDec 9, 2014
  2. Mike HommeyDec 9, 2014
  3. Joshua JensenDec 9, 2014
  4. Jonathan NiederDec 9, 2014
  5. Joshua JensenDec 9, 2014
  6. Junio C HamanoDec 9, 2014
  7. fast-import: add options to enable/disable case foldingMike Hommey, Apr 17, 2015
  8. Torsten BögershausenApr 17, 2015
  9. Junio C HamanoApr 17, 2015
  10. Mike HommeyApr 18, 2015
  11. Luke DiamandApr 24, 2015
  12. Eric SunshineApr 17, 2015

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.