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
Jeff King <peff@peff.net>
Date
Aug 26, 2025, 11:19 UTC
Message-ID
<20250826111952.GA1926324@coredump.intra.peff.net>
In-Reply-To
<20250820213323.GA1667633@coredump.intra.peff.net>
On Wed, Aug 20, 2025 at 05:33:23PM -0400, Jeff King wrote:
Show 10 quoted lines
> If so, and assuming you're on a case-insensitive filesystem, then the
> lock files would collide. You wouldn't see anything after the fact
> because git-fetch itself would create the colliding lockfile, and then
> clean it up after hitting the fatal error.
> 
> 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
The response below came to me off-list. Here it is quoted with my reply:
On Sun, Aug 24, 2025 at 05:03:20PM +0100, Dave Evans wrote:
Show 22 quoted lines
> I'm sorry but I do not have an email client I could use to post to the
> git mailing list.
> Please could you post my thoughts on this to the list.
>
> https://lore.kernel.org/git/20250820213323.GA1667633@coredump.intra.peff.net/
>
> I use git 2.51.0 built using Macports on a very old version of macOS
>
> There are a couple of repos on github that were showing this problem:
> vectorgraphics/asymptote
> ghc/ghc
>
> Both of them were bare clones.
>
> I applied  --ref-format=reftable to the vectorgraphics/asymptote repo
> and a fetch
> went through to the end successfully
>
> The only snag I can see is that cgit no longer works. It says :
> Failed to open github/vectorgraphics/asymptote: No such file or directory
>
> The version of cgit is about 5 years old

I think that's all expected. Unlike most systems which call Git commands like for-each-ref, etc, to access the ref store, cgit is linked directly against Git's C code (something we don't support, but the cgit authors accepted as a risk). So an old version of cgit will link against an old version of Git, and won't know about reftable at all.

It _might_ not even be able to detect the directory as a git repo, though I thought the reftable format was designed to let even old versions of Git see the repo (e.g., the dummy value in HEAD).

-Peff
Previous: Joe DrewNext: Patrick Steinhardt
Message 15 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.