Re: [PATCH v2] branch: report active bisect run when rejecting delete
On 26/07/2026 16:36, Junio C Hamano wrote:
Show 26 quoted lines
> René Scharfe <l.s.r@web.de> writes:
>
>> git branch refuses to delete branches that are currently checked out
>> with a message like this: "error: cannot delete branch 'foo' used by
>> worktree at '/path/of/worktree'". This can be confusing if it's an
>> internal checkout for git bisect. Report a more specific error in
>> that case to help users that might have forgotten their bisect run.
>>
>> Suggested-by: stsp <stsp2@yandex.ru>
>> Signed-off-by: René Scharfe <l.s.r@web.de>
>> ---
>> Changes since v2:
>> - Only report bisect runs as specific rejection reason for now.
>> - Leave rebasing unaddressed because I don't see how to formulate
>> clear and readable messages for those scenarios, yet.
>> - Collect all checkout reasons of all branches in a simple array for
>> easy use, e.g. to eventually address rebases or for git status.
>> - Rebased onto the landed test_grep conversion.
>
> The scope of this patch has shrunk a bit. While the 'in use by a
> rebase' state is still recognized internally, unlike in the previous
> round, we guard users only against the 'in use by a bisect' state and
> the 'in use by being checked out' state.
>
> This is probably a good single step, so unless there are objections,
> let's mark the topic for 'next'.
I agree this is a useful improvement as it is.
Thanks
Phillip
Show 6 quoted lines
> My understanding of what is stopping us from taking the next step is
> that we do not know the exact phrasing to express the 'in use by a
> rebase' state concisely.
>
> Thanks.
>