Re: Possible minor bug in Git
- Date: Sun, 10 Feb 2019 23:46:08 +0100
- From: Giuseppe Crino' <giuscri@xxxxxxxxx>
- Subject: Re: Possible minor bug in Git
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
@@ -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);
icase = git_env_bool(GIT_ICASE_PATHSPECS_ENVIRONMENT, 0);
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`  that is normally auto detected that can be used to
> decide when the checks should be done and advice  or warnings given.