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

[PATCH] lockfile: add case insensitive filesystem note

From
AGAlan Da Costa via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 22, 2025, 21:54 UTC
Message-ID
<pull.2053.git.git.1758578084468.gitgitgadget@gmail.com>
From: Alan Da Costa <alandacosta@gmail.com>
* Add note of case insensitive client filesystems may error due to a lock
  on a case variant ref to more quickly identify failure in fetch/pull
Signed-off-by: Alan Da Costa <alandacosta@gmail.com>
---
    lockfile: add case insensitive filesystem note
    
    When running git fetch or git pull on a case insensitive filesystem
    (e.g., default macOS), if multiple case variants of the same remote ref
    exist (often after a case-only rename), both variant locks map to the
    same on-disk path. When a local update is required, Git creates a lock
    for the first variant and then attempts to lock the second, which
    collides with the same lock file, so an “existing lock” error is
    reported. The underlying issue is mixed-case refs; resolve it by
    consolidating the remote to a single-case variant and update local refs
    accordingly.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2053%2Fadacosta%2Flockfile-add-case-insensitive-filesystem-note-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2053/adacosta/lockfile-add-case-insensitive-filesystem-note-v1
Pull-Request: https://github.com/git/git/pull/2053
 lockfile.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lockfile.c b/lockfile.c
index 1d5ed01682..99a470bd3d 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -156,7 +156,10 @@ void unable_to_lock_message(const char *path, int err, struct strbuf *buf)
 		    "an editor opened by 'git commit'. Please make sure all processes\n"
 		    "are terminated then try again. If it still fails, a git process\n"
 		    "may have crashed in this repository earlier:\n"
-		    "remove the file manually to continue."),
+		    "remove the file manually to continue.\n\n"
+		    "On case insensitive client filesystems, multiple mixed-case refs will resolve\n"
+		    "to the same lock file, possibly causing this error. If so, ensure your remote\n"
+		    "refs have a single case variant."),
 			    absolute_path(path), strerror(err));
 	} else
 		strbuf_addf(buf, _("Unable to create '%s.lock': %s"),

base-commit: ab427cd991100e94792fce124b0934135abdea4b
-- 
gitgitgadget
Next: Junio C Hamano
Message 1 of 4 in “lockfile: add case insensitive filesystem note”
  1. lockfile: add case insensitive filesystem noteAlan Da Costa via GitGitGadget, Sep 22, 2025
  2. Junio C HamanoSep 22, 2025
  3. Patrick SteinhardtSep 23, 2025
  4. Karthik NayakSep 23, 2025

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.