Re: bug report: spurious "cannot delete branch '%s' used by worktree"
- From
- phillip.wood123@gmail.com <phillip.wood123@gmail.com>
- Date
- Apr 2, 2024, 15:15 UTC
- Message-ID
- <566bc6ac-d4d6-45e2-9875-575e187280a7@gmail.com>
- In-Reply-To
- <CAEYvaskG0BBVr+nsQ+iof=AXu3dcQHx0aRRrKRrf8e_NFANL9A@mail.gmail.com>
On 02/04/2024 12:56, Tamir Duberstein wrote:
[cc'ing Christian who knows more about "git bisect" than me]
Show 16 quoted lines
> On Tue, Apr 2, 2024 at 12:29 PM <phillip.wood123@gmail.com> wrote: >> 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 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.
Oh good I'm glad we've found the problem.
> I guess the only action item would be to improve the error message.
Yes, there was some discussion about that relatively recently when the message was changed to say "in use" rather than "checked out". Adding the appropriate command name into the message would help.
When bisecting "git switch" prints a warning but still switches branches, "git checkout" performs the checkout with no warning. I wonder if (a) "git switch" should refuse to run without "--detach" when there is a bisection in progress and (b) if "git bisect" could be more helpful when it finds the broken commit by telling the user that they should run "git bisect reset" to clean up.
Best Wishes
Phillip