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

Re: [PATCH v3 1/1] abspath_part_inside_repo: respect core.fileMode

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 18, 2019, 12:55 UTC
Message-ID
<nycvar.QRO.7.76.6.1901181351250.41@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqqa7kuat8j.fsf@gitster-ct.c.googlers.com>
Hi Junio,

first of all, my apologies for the incorrect commit message (you missed it, too, though): it is not about respecting core.fileMode, but about core.ignoreCase.

On Tue, 25 Dec 2018, Junio C Hamano wrote:
Show 27 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > the resulting index entry is "blub" or "BLUB".  Shouldn't we verify
> > that "git add" adds an expected path to the index, instead of
> > blindly trusting that it says "Yeah, I did as I was told" with its
> > exit status?  Would we be adding 'blub' as that is what we told
> > 'git' to add, or would it be 'BLUB' as that is what exists on the
> > filesystem that is case insensitive but case preserving?
> 
> Needless to say, the last part of the above is a mere thetorical
> question, and I am not questioning the established behaviour or
> suggesting to "improve" it.  On a case insensitive filesystem, we
> trust what readdir() gave us (but match them with pathspec case
> insensitively) for a new path that is not in the index.  When we
> update the contents of a path that is already in the index, we
> preserve the case in the index, even when readdir() reports the same
> path in different case (iow, we trust the case in the index more
> than what readdir() gives us)..
> 
> What I am wondering in the above is if we should document that in
> the test, perhaps with a simple
> 
> 	git ls-files blub >actual &&
> 	echo BLUB >expect &&
> 	test_cmp expect actual
> 
> or something like that.

Actually, I would interpret the description in our documentation to mean that Git does not want to trust what readdir() gave us but heed what the user said, i.e. when `BLUB` is added as `git add blub`, Git really should think that it is `blub`, not `BLUB` (i.e. the exact opposite of what you suggest). From Documentation/config/core.txt's section about `core.ignoreCase`:

	For example, if a directory listing finds "makefile" when Git
	expects "Makefile", Git will assume it is really the same file,
	and continue to remember it as "Makefile".

Ciao, Dscho

Previous: Junio C HamanoNext: Johannes Schindelin via GitGitGadget
Message 13 of 15 in “Make abspath() aware of case-insensitive filesystems”
  1. 0/1 Make abspath() aware of case-insensitive filesystemsJohannes Schindelin via GitGitGadget, Dec 21, 2018
  2. 1/1 abspath_part_inside_repo: respect core.fileModeJohannes Schindelin via GitGitGadget, Dec 21, 2018
  3. Carlo ArenasDec 22, 2018
  4. Johannes SchindelinDec 24, 2018
  5. 0/1 Make abspath() aware of case-insensitive filesystemsJohannes Schindelin via GitGitGadget, Dec 24, 2018
  6. 1/1 abspath_part_inside_repo: respect core.fileModeJohannes Schindelin via GitGitGadget, Dec 24, 2018
  7. Torsten BögershausenDec 25, 2018
  8. Johannes SchindelinJan 18, 2019
  9. 0/1 Make abspath() aware of case-insensitive filesystemsJohannes Schindelin via GitGitGadget, Dec 24, 2018
  10. 1/1 abspath_part_inside_repo: respect core.fileModeJohannes Schindelin via GitGitGadget, Dec 24, 2018
  11. Junio C HamanoDec 25, 2018
  12. Junio C HamanoDec 25, 2018
  13. Johannes SchindelinJan 18, 2019
  14. 0/1 Make abspath() aware of case-insensitive filesystemsJohannes Schindelin via GitGitGadget, Jan 18, 2019
  15. 1/1 abspath_part_inside_repo: respect core.ignoreCaseJohannes Schindelin via GitGitGadget, Jan 18, 2019

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.