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

Re: [BUG] refs: verify does not work if there are v2.43.0 or older worktrees w/o wt. refs

From
shejialuo <shejialuo@gmail.com>
Date
May 31, 2025, 01:03 UTC
Message-ID
<aDpVd8J-TfhvTyA3@ArchLinux>
In-Reply-To
<CAPig+cQiw03qfwwE9Md+LdKeS-6BGx0M1+0YYDUDXO9UPVo+wg@mail.gmail.com>
On Fri, May 30, 2025 at 06:23:25PM -0400, Eric Sunshine wrote:
Show 13 quoted lines
> On Fri, May 30, 2025 at 3:00 PM <kristofferhaugsbakk@fastmail.com> wrote:
> > git-refs-verify(1) checks worktree refs since v2.47.0-111-g7c78d819e6a
> > (ref: support multiple worktrees check for refs, 2024-11-20).  This
> > causes the command to always exit with code `255` and stderr output
> > lines for each worktree created on v2.43.0 or older that does not have
> > worktree refs:
> >
> >     error: cannot open directory .git/worktrees/<worktree name>/refs: No such file or directory
> 
> Interesting. I didn't follow the topic which introduced 7c78d819e6
> (ref: support multiple worktrees check for refs, 2024-11-20), but I
> can confirm that this is a problem.
> 

Yes, I didn't realize about this. Thank Kristoffer for reporting this issue and you for confirming this. I would write a patch today to fix this issue. And hope that this fix would land in this release.

Show 11 quoted lines
> > This is apparently caused by worktrees created on Git v2.43.0 or older.
> > Apparently these worktrees don’t have this directory unless there exist
> > worktree refs:
> >
> >     .git/worktrees/<worktree name>/refs
> 
> Indeed, the "refs" subdirectory was not present by default in older
> Git versions. Were you able to track down which commit is responsible
> for that directory getting created automatically when the worktree
> gets created?
> 

I find out that; in 8f4c00de95 (builtin/worktree: create refdb via ref backend, 2024-01-08)

Previous: Eric SunshineNext: Kristoffer Haugsbakk
Message 3 of 21 in “[BUG] refs: verify does not work if there are v2.43.0 or older worktrees w/o wt. refs”
  1. kristofferhaugsbakk@fastmail.comMay 30, 2025
  2. Eric SunshineMay 30, 2025
  3. shejialuoMay 31, 2025
  4. Kristoffer HaugsbakkMay 31, 2025
  5. fsck: ignore missing "refs" directory for linked worktreesshejialuo, May 31, 2025
  6. Kristoffer HaugsbakkMay 31, 2025
  7. Junio C HamanoJun 2, 2025
  8. shejialuoJun 2, 2025
  9. Phillip WoodJun 2, 2025
  10. Patrick SteinhardtJun 2, 2025
  11. phillip.wood123@gmail.comJun 2, 2025
  12. Junio C HamanoJun 2, 2025
  13. shejialuoJun 2, 2025
  14. shejialuoJun 2, 2025
  15. 0/1 [BUG] refs: verify does not work if there are v2.43.0 or older worktrees w/o wt. refsshejialuo, Jun 2, 2025
  16. 1/1 fsck: ignore missing "refs" directory for linked worktreesshejialuo, Jun 2, 2025
  17. Kristoffer HaugsbakkJun 2, 2025
  18. shejialuoJun 2, 2025
  19. 0/1 [BUG] refs: verify does not work if there are v2.43.0 or older worktrees w/o wt. refsshejialuo, Jun 2, 2025
  20. 1/1 fsck: ignore missing "refs" directory for linked worktreesshejialuo, Jun 2, 2025
  21. Kristoffer HaugsbakkJun 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.