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)