git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giuseppe Crino' <giuscri@gmail.com>
To: git@vger.kernel.org
Cc: Philip Oakley <philipoakley@iee.org>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	tboegi@web.de, angelomelonas@gmail.com
Subject: Re: Possible minor bug in Git
Date: Sun, 10 Feb 2019 23:46:08 +0100	[thread overview]
Message-ID: <20190210224607.GA118@evil.localdomain> (raw)
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

      reply	other threads:[~2019-02-10 22:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31  7:01 Possible minor bug in Git Angelo Melonas
2019-01-31  7:29 ` Angelo Melonas
2019-01-31 20:34   ` Torsten Bögershausen
2019-02-01  8:02     ` Angelo Melonas
2019-02-02  6:38       ` Torsten Bögershausen
2019-02-06 22:17         ` Giuseppe Crinò
2019-02-07 19:41           ` Johannes Schindelin
2019-02-08 17:43             ` Torsten Bögershausen
2019-02-09 18:19             ` Philip Oakley
2019-02-10 22:46               ` Giuseppe Crino' [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190210224607.GA118@evil.localdomain \
    --to=giuscri@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=angelomelonas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=philipoakley@iee.org \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).