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

Re: [PATCH v2] branch: report active bisect run when rejecting delete

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 26, 2026, 15:36 UTC
Message-ID
<xmqqbjbtyd80.fsf@gitster.g>
In-Reply-To
<590382fb-731b-4e14-911e-ff68356d1082@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 16 quoted lines
> 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'.

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.
Previous: René ScharfeNext: Toon Claes
Message 8 of 10 in “branch: report kind of checkout when rejecting delete”
  1. branch: report kind of checkout when rejecting deleteRené Scharfe, Jul 18, 2026
  2. Junio C HamanoJul 18, 2026
  3. René ScharfeJul 18, 2026
  4. Junio C HamanoJul 18, 2026
  5. René ScharfeJul 19, 2026
  6. Phillip WoodJul 19, 2026
  7. branch: report active bisect run when rejecting deleteRené Scharfe, Jul 25, 2026
  8. Junio C HamanoJul 26, 2026
  9. Toon ClaesJul 28, 2026
  10. Phillip WoodJul 29, 2026

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.