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

Re: Possible minor bug in Git

From
Giuseppe Crino' <giuscri@gmail.com>
Date
Feb 10, 2019, 22:46 UTC
Message-ID
<20190210224607.GA118@evil.localdomain>
In-Reply-To
<788eefef-f677-f0ce-7e02-dd85b11da78a@iee.org>
Setting `true` as the default for GIT_ICASE_PATHSPECS_ENVIRONMENT, when git is built on a Windows system, solves the bug.
	diff --git a/pathspec.c b/pathspec.c
	index 12c2b322b3..906cf24e3e 100644
	--- a/pathspec.c
	+++ b/pathspec.c
	@@ -237,7 +237,11 @@ static inline int get_icase_global(void)
		static int icase = -1;
		if (icase < 0)
	+       #if defined(GIT_WINDOWS_NATIVE) || defined(__CYGWIN__)
	+               icase = git_env_bool(GIT_ICASE_PATHSPECS_ENVIRONMENT, 1);
	+       #else
			icase = git_env_bool(GIT_ICASE_PATHSPECS_ENVIRONMENT, 0);
	+       #endif
		return icase;
	 }
Unfortunately that fix introduces a regression too, tested in t/t3700-add.sh --- `error out when attempting to add ignored ones but add others`.
I already spent some time to understand why, but got no luck: I have to dive deeper into the source code.
In case I can fix the regression, is changing the default value of that env variable a good solution? Should I change the approach?
Like leveraging core.ignorecase somewhere ...?
On Sat, Feb 09, 2019 at 06:19:11PM +0000, Philip Oakley wrote:
> The root cause of the issues will most probably be use of a case insensitive
> file system on Windows (and Mac). There is a configuration flag
> `core.ignoreCase` [1] that is normally auto detected that can be used to
> decide when the checks should be done and advice [2] or warnings given.
Thanks,
Giuseppe
Previous: Philip Oakley
Message 10 of 10 in “Possible minor bug in Git”
  1. Angelo MelonasJan 31, 2019
  2. Angelo MelonasJan 31, 2019
  3. Torsten BögershausenJan 31, 2019
  4. Angelo MelonasFeb 1, 2019
  5. Torsten BögershausenFeb 2, 2019
  6. Giuseppe CrinòFeb 6, 2019
  7. Johannes SchindelinFeb 7, 2019
  8. Torsten BögershausenFeb 8, 2019
  9. Philip OakleyFeb 9, 2019
  10. Giuseppe Crino'Feb 10, 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.