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

Re: [PATCH] fast-import: add options to enable/disable case folding

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 17, 2015, 18:44 UTC
Message-ID
<xmqqwq1appcf.fsf@gitster.dls.corp.google.com>
In-Reply-To
<55313B4B.3030106@web.de>
Torsten Bögershausen <tboegi@web.de> writes:
Show 9 quoted lines
>> +--[no-]fold-case::
>> +	When files/directories with the same name but a different case
>> +	are detected, they are treated as the same (--fold-case) or as
>> +	being different (--no-fold-case). The default is --fold-case
>> +	when `core.ignorecase` is set to `true`, and --no-fold-case when
>> +	it is `false`.
>> +
> Most often the we use the term "ignore-case", could that be a better name ?
> Other opinions, pros/cons  ?

Yeah, --[no-]ignore-case sounds more in line with how other commands' options are spelled.

But I somehow thought this "case-folding" was deliberately done as an improvement against the original that did not have a way to do the "ignore-case"?

http://thread.gmane.org/gmane.comp.version-control.git/200597/focus=200625

I am not sure why not until now I did not find the original justification dubious, but I think fast-export should never do case folding---Joshua talks about working trees on a file system that is incapable of expressing different cases, but "export" is about reading in-repository histories, whose trees are fully capable of expressing paths in different cases just fine, and spitting out a file that can be processed by fast-import. I do not see why it should collapse two different paths that differ in case at export time.

If the original history is broken by Perforce or whatever and recording the history of the same path in different case combinations in different commits, perhaps the right thing to do is to fix the original history in Git repository before exporting in the first place.

I do not see how such a corruption is related to the characteristics of the filesystem where "export" is run. Perhaps a case-insensitive filesystem may helped Perforce to corrupt the history when initial import of the history into Git was done, but core.ignorecase of the current repository does not help us decide if that was actually the case---the import may have been done on a completely different machine.

So perhaps we should rip the case folding out altogether instead? The entry for the change in the Release Notes may say:

 * "git fast-import" incorrectly case-folded the paths recorded in
   the history when core.ignorease is set (i.e. the repository's
   working tree is incapable of expressing paths that differ only in
   their cases); this old bug was reported in 2012 and was finally
   corrected.
or something like that?
Previous: Torsten BögershausenNext: Mike Hommey
Message 9 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.