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

[PATCH 1/4] git-init: autodetect core.ignorecase

From
Steffen Prohaska <prohaska@zib.de>
Date
May 11, 2008, 16:16 UTC
Message-ID
<1210522602-4724-1-git-send-email-prohaska@zib.de>
From: Dmitry Potapov <dpotapov@gmail.com>

We already detect if symbolic links are supported by the filesystem. This patch adds autodetect for case-insensitive filesystems, such as VFAT and others.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
 builtin-init-db.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/builtin-init-db.c b/builtin-init-db.c
index 2854868..3721bd2 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -255,8 +255,8 @@ static int create_default_files(const char *git_dir, const char *template_path)
 			git_config_set("core.worktree", work_tree);
 	}
 
-	/* Check if symlink is supported in the work tree */
 	if (!reinit) {
+		/* Check if symlink is supported in the work tree */
 		path[len] = 0;
 		strcpy(path + len, "tXXXXXX");
 		if (!close(xmkstemp(path)) &&
@@ -267,6 +267,12 @@ static int create_default_files(const char *git_dir, const char *template_path)
 			unlink(path); /* good */
 		else
 			git_config_set("core.symlinks", "false");
+
+		/* Check if the filesystem is case-insensitive */
+		path[len] = 0;
+		strcpy(path + len, "CoNfIg");
+		if (!access(path, F_OK))
+			git_config_set("core.ignorecase", "true");
 	}
 
 	return reinit;
-- 
1.5.5.1.313.g9decb
Next: Steffen Prohaska
Message 1 of 6 in “git-init: autodetect core.ignorecase”
  1. 1/4 git-init: autodetect core.ignorecaseSteffen Prohaska, May 11, 2008
  2. 2/4 t0050: Test autodetect core.ignorecaseSteffen Prohaska, May 11, 2008
  3. 3/4 t0050: Set core.ignorecase case to activate case insensitivitySteffen Prohaska, May 11, 2008
  4. 4/4 t0050: Add test for case insensitive addSteffen Prohaska, May 11, 2008
  5. Linus TorvaldsMay 11, 2008
  6. 0/4 core.ignorecaseSteffen Prohaska, May 11, 2008

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.