From: Junio C Hamano <gitster@pobox.com>
To: "Alan Da Costa via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Alan Da Costa <alandacosta@gmail.com>
Subject: Re: [PATCH] lockfile: add case insensitive filesystem note
Date: Mon, 22 Sep 2025 15:19:07 -0700 [thread overview]
Message-ID: <xmqq8qi6ruzo.fsf@gitster.g> (raw)
In-Reply-To: <pull.2053.git.git.1758578084468.gitgitgadget@gmail.com> (Alan Da Costa via GitGitGadget's message of "Mon, 22 Sep 2025 21:54:44 +0000")
"Alan Da Costa via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 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
This does not have to be a single-item bulletted list. Please lose
the leading "* " from the first line, and " " from the second line,
and finish the whole sentence with a full-stop "."
> Signed-off-by: Alan Da Costa <alandacosta@gmail.com>
> ---
>
> 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.
And the message update may help unconfusing the user who gets this
error, which is a good idea. Thanks for working on this.
> The underlying issue is mixed-case refs; resolve it by
> consolidating the remote to a single-case variant and update local refs
> accordingly.
This does not seem to match anything the patch does, though ;-)
>
> 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));
The two lines in the new part of the message seem to be longer than
usual by two words or so. Can you line wrap to balance?
The error is about our "local" filesystem, isn't it? If you do not
have control over what the remote does, you have no recourse. If
using the reftable backend on the local end work around the local
filesystem's case insensitivity, that would be a better suggestion
to give that such a user can actually act on.
In any case, wouldn't it make more sense to do this change
conditionally by looking at the value of the ignore_case global
(which in turn came from the core.ignorecase setting in .git/config
when the repository was created by probing the filesystem
capabilities)? If you get this error and you are on a case
sensitive system, the additional hints will lead the user to a
wild goose chase.
Thanks.
next prev parent reply other threads:[~2025-09-22 22:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-22 21:54 [PATCH] lockfile: add case insensitive filesystem note Alan Da Costa via GitGitGadget
2025-09-22 22:19 ` Junio C Hamano [this message]
2025-09-23 7:56 ` Patrick Steinhardt
2025-09-23 9:03 ` Karthik Nayak
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=xmqq8qi6ruzo.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=alandacosta@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
/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).