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

Re: [PATCH 3/4] t0050: Set core.ignorecase case to activate case insensitivity

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
May 11, 2008, 17:10 UTC
Message-ID
<alpine.LFD.1.10.0805111005260.3330@woody.linux-foundation.org>
In-Reply-To
<1210522602-4724-3-git-send-email-prohaska@zib.de>
On Sun, 11 May 2008, Steffen Prohaska wrote:
Show 6 quoted lines
>
> Case insensitive file handling is only active when
> core.ignorecase = true.  Hence, we need to set it to give the tests
> in t0050 a chance to succeed.  Setting core.ignorecase explicitly
> allows to test some aspects of case handling even on case sensitive file
> systems.

The patch series looks fine to me, but I just wanted to underline the use of that "*some*aspects*" part.

On a filesystem that is case sensitive, doing "core.ignorecase = true" doesn't magically make git act as if the filesystem was insensitive to case. In particular, since the filesystem very much can contain two different versions of a filename in different case, git will actually notice that, and notice that "CamelCase" and "camelcase" are not necessarily the same file.

To emulate case insensitivity on filesyststems that are actually sensitive, we could do some tests that do things like

	echo Hello > CamelCase
	ln CamelCase camelcase

and now git will see something that is *closer* to a real case-insensitive filesystem: two names that resolve to the same stat information.

It's still obviously not identical (because "readdir()" will get two entries), and as such a test that succeeds in a true case-insensitive environment will not necessarily work in the above fake kind of situation, but at least you can test some cases.

Renaming the same file to a case that is different is also a worthwhile thing to try to "emulate" case insensitivity.

			Linus
Previous: Steffen ProhaskaNext: Steffen Prohaska
Message 5 of 6 in “git-init: autodetect core.ignorecase”
  1. 1/4 git-init: autodetect core.ignorecaseSteffen Prohaska, May 11, 2008
  2. 2/4 t0050: Test autodetect core.ignorecaseSteffen Prohaska, May 11, 2008
  3. 3/4 t0050: Set core.ignorecase case to activate case insensitivitySteffen Prohaska, May 11, 2008
  4. 4/4 t0050: Add test for case insensitive addSteffen Prohaska, May 11, 2008
  5. Linus TorvaldsMay 11, 2008
  6. 0/4 core.ignorecaseSteffen Prohaska, May 11, 2008

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.