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

Re: bug report: spurious "cannot delete branch '%s' used by worktree"

From
TDTamir Duberstein <tamird@fuseenergy.com>
Date
Apr 2, 2024, 11:56 UTC
Message-ID
<CAEYvaskG0BBVr+nsQ+iof=AXu3dcQHx0aRRrKRrf8e_NFANL9A@mail.gmail.com>
In-Reply-To
<740d1f1a-40ce-4714-91bd-1ba448e9d672@gmail.com>
On Tue, Apr 2, 2024 at 12:29 PM <phillip.wood123@gmail.com> wrote:
Show 29 quoted lines
>
> Hi Tamir
>
> On 02/04/2024 11:26, Tamir Duberstein wrote:
> > On Tue, Apr 2, 2024 at 11:10 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
> >> On 31/03/2024 07:49, Eric Sunshine wrote:
> >> Thanks Eric. I'd have thought that "git worktree list" would say
> >> something about the branch being rebased if there was enough state lying
> >> around to prevent the branch being deleted, but lets see. What does
> >>
> >>       ls $(git rev-parse --git-path rebase-merge) $(git rev-parse
> >> --git-path rebase-apply)
> >>
> >> show when you run it in <my source dir>? Also is <my source dir> the
> >> only worktree?
> >
> > % ls $(git rev-parse --git-path rebase-merge) $(git rev-parse
> > --git-path rebase-apply)
> > ls: .git/rebase-apply: No such file or directory
> > ls: .git/rebase-merge: No such file or directory
>
> Thanks for trying that - at least we know it isn't a problem with
> rebase. Lets check if there is a stale bisect (sorry I forgot about that
> earlier). What do
>
>      cat .git/BISECT_START
>      ls .git | grep -i bisect
>
> show?

This was the culprit! There was indeed a ` .git/BISECT_START` containing "cleanup". After deleting this file I am able to remove the branch.

Show 6 quoted lines
> > Yes, it's the only worktree.
> In that case can you check that
>
>      ls .git/worktrees
>
> fails because the directory is missing or shows an empty directory please.
% cat .git/worktrees
cat: .git/worktrees: No such file or directory
> Thanks
>
> Phillip
I guess the only action item would be to improve the error message.
Previous: phillip.wood123@gmail.comNext: phillip.wood123@gmail.com
Message 10 of 11 in “bug report: spurious "cannot delete branch '%s' used by worktree"”
  1. Tamir DubersteinMar 28, 2024
  2. Eric SunshineMar 28, 2024
  3. Tamir DubersteinMar 28, 2024
  4. Eric SunshineMar 31, 2024
  5. Tamir DubersteinMar 31, 2024
  6. Phillip WoodApr 2, 2024
  7. Tamir DubersteinApr 2, 2024
  8. Kristoffer HaugsbakkApr 2, 2024
  9. phillip.wood123@gmail.comApr 2, 2024
  10. Tamir DubersteinApr 2, 2024
  11. phillip.wood123@gmail.comApr 2, 2024

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.