On Thu, Nov 23, 2023 at 11:33 AM Phillip Wood <phillip.wood123@xxxxxxxxx> wrote: > On 23/11/2023 06:00, Junio C Hamano wrote: > > "git checkout -B <branch> [<start-point>]", being a "forced" version > > of "-b", switches to the <branch>, after optionally resetting its > > tip to the <start-point>, even if the <branch> is in use in another > > worktree, which is somewhat unexpected. > > > > Protect the <branch> using the same logic that forbids "git checkout > > <branch>" from touching a branch that is in use elsewhere. > > > > This is a breaking change that may deserve backward compatibliity > > warning in the Release Notes. The "--ignore-other-worktrees" option > > can be used as an escape hatch if the finger memory of existing > > users depend on the current behaviour of "-B". > > I think this change makes sense and I found the implementation here much > easier to understand than a previous attempt at > https://lore.kernel.org/git/20230120113553.24655-1-carenas@xxxxxxxxx/ Thanks for digging up this link. Upon reading the problem report, I felt certain that we had seen this issue reported previously and that patches had been proposed, but I was unable to find the conversation (despite having taken part in it). I agree, also, that this two-patch series is simple to digest.