All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Thomas Rast <trast@student.ethz.ch>
Cc: PJ Weisberg <pj@irregularexpressions.net>, <git@vger.kernel.org>
Subject: Re: [PATCH] Demonstrate failure of 'core.ignorecase = true'
Date: Fri, 23 Mar 2012 10:47:48 -0700	[thread overview]
Message-ID: <7v62dvus3f.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <87pqc3ei08.fsf@thomas.inf.ethz.ch> (Thomas Rast's message of "Fri, 23 Mar 2012 11:20:07 +0100")

Thomas Rast <trast@student.ethz.ch> writes:

> How about trying to read "HEAD" as "head" instead when core.ignorecase
> is true?  That would allow us to catch such misconfiguration (which I
> imagine can also happen accidentally if you mv a repository across FS
> boundaries) and tell the user about it.

Do you mean something like this?

I do not like it.  It essentially amounts to checking with the FS every
time we run Git.

 config.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/config.c b/config.c
index 68d3294..8783937 100644
--- a/config.c
+++ b/config.c
@@ -575,7 +575,16 @@ static int git_default_core_config(const char *var, const char *value)
 	}
 
 	if (!strcmp(var, "core.ignorecase")) {
+		static int true_case; /* 0: unknown, 1: sensitive, 2: fat */
 		ignore_case = git_config_bool(var, value);
+		if (ignore_case) {
+			if (!true_case) {
+				true_case = fs_is_case_sensitive() ? 1 : 2;
+				if (true_case == 2)
+					warn("Whoa");
+			}
+			ignore_case = true_case >> 1;
+		}
 		return 0;
 	}
 

  reply	other threads:[~2012-03-23 17:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-21 22:50 [PATCH] Demonstrate failure of 'core.ignorecase = true' Peter J. Weisberg
2012-03-21 23:58 ` Junio C Hamano
2012-03-22 20:40   ` PJ Weisberg
2012-03-22 21:08     ` Junio C Hamano
2012-03-23 10:20       ` Thomas Rast
2012-03-23 17:47         ` Junio C Hamano [this message]
2012-03-23 18:48           ` Jeff King
2012-03-23 18:57             ` Jeff King
2012-03-22  6:49 ` Johannes Sixt
2012-03-22 11:25   ` Zbigniew Jędrzejewski-Szmek
2012-03-22 14:12     ` Jeff King
2012-03-22 16:57       ` Junio C Hamano
2012-03-22 17:37         ` Jeff King
2012-03-22 18:44           ` Junio C Hamano
2012-03-22 19:07             ` Jeff King
2012-03-22 20:33               ` Junio C Hamano
2012-03-22 20:00             ` Zbigniew Jędrzejewski-Szmek
2012-03-22 20:37               ` Junio C Hamano
2012-03-22 20:53                 ` Zbigniew Jędrzejewski-Szmek
2012-03-22 20:55                 ` PJ Weisberg
2012-03-22 21:09                   ` Junio C Hamano
2012-03-22 23:00               ` Jeff King
2012-03-22 23:24                 ` Junio C Hamano

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=7v62dvus3f.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pj@irregularexpressions.net \
    --cc=trast@student.ethz.ch \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.