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

Re: "lock file exists" when fetching in bare clone of repository

From
JDJoe Drew <joe.drew@indexexchange.com>
Date
Aug 22, 2025, 13:28 UTC
Message-ID
<YQXPR01MB3046646D7BF687D5533B41FC9A3DA@YQXPR01MB3046.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To
<20250820213323.GA1667633@coredump.intra.peff.net>
> This is a wild guess, but: are there any case collisions with that
> branch name (e.g., PTV-2164 or something) in the upstream repo?
Yes, actually! The only difference is in case (ptv-2164 vs PTV-2164).
Show 5 quoted lines
> If that is the case, you can try using the reftables backend in v2.51.0.
> It doesn't use the filesystem for its ref storage or locking. Something
> like:
>
>  git init --bare --ref-format=reftable
Reftable does, in fact, solve this!
Show 10 quoted lines
>> This error _does not_ happen in the Apple-supplied version of git:
>> `git version 2.39.5 (Apple Git-154)`, but does in 2.51.0, which I
>> installed with homebrew. (If this is a packaging error, I'll happily
>> report to homebrew.)
>
> That is definitely weird, and not something I'd expect if it's just a
> case collision. Is it possible for you to build Git from source? If so,
> and the problem happens with your build of 2.51.0 but not v2.39.5, it
> would be very enlightening to see the results of "git bisect". We can
> provide more guidance if you need with that process.
I bisected (git 2.39.5 built from source _also_ doesn't have this issue), and found the first bad commit:
0e358de64a9e014575d11ef884bfc9beb931e37f is the first bad commit
commit 0e358de64a9e014575d11ef884bfc9beb931e37f
Author: Karthik Nayak <karthik.188@gmail.com>
Date:   Mon May 19 11:58:07 2025 +0200
    fetch: use batched reference updates
    The reference updates performed as a part of 'git-fetch(1)', take place
    one at a time. For each reference update, a new transaction is created
    and committed. This is necessary to ensure we can allow individual
    updates to fail without failing the entire command. The command also
    supports an '--atomic' mode, which uses a single transaction to update
    all of the references. But this mode has an all-or-nothing approach,
    where if a single update fails, all updates would fail.
CONFIDENTIALITY NOTICE AND DISCLAIMER : This telecommunication, including any and all attachments, contains confidential information intended only for the person(s) to whom it is addressed. Any dissemination, distribution, copying or disclosure is strictly prohibited and is not a waiver of confidentiality. If you have received this telecommunication in error, please notify the sender immediately by return electronic mail and delete the message from your inbox and deleted items folders. This telecommunication does not constitute an express or implied agreement to conduct transactions by electronic means, nor does it constitute a contract offer, a contract amendment or an acceptance of a contract offer. Contract terms contained in this telecommunication are subject to legal review and the completion of formal documentation and are not binding until same is confirmed in writing and has been signed by an authorized signatory.
Previous: Junio C HamanoNext: Jeff King
Message 14 of 16 in “"lock file exists" when fetching in bare clone of repository”
  1. Joe DrewAug 20, 2025
  2. Jeff KingAug 20, 2025
  3. Patrick SteinhardtAug 21, 2025
  4. Jeff KingAug 21, 2025
  5. Patrick SteinhardtAug 21, 2025
  6. Junio C HamanoAug 21, 2025
  7. Patrick SteinhardtAug 22, 2025
  8. Karthik NayakAug 22, 2025
  9. Junio C HamanoAug 22, 2025
  10. Karthik NayakAug 28, 2025
  11. Junio C HamanoAug 28, 2025
  12. Karthik NayakSep 1, 2025
  13. Junio C HamanoAug 21, 2025
  14. Joe DrewAug 22, 2025
  15. Jeff KingAug 26, 2025
  16. Patrick SteinhardtSep 2, 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.