From: Gabriel Scherer Date: Sun, 14 Sep 2025 07:50:57 GMT Subject: Re: [PATCH 1/3] checkout: provide hint when failing due to another worktree Message-ID: In-Reply-To: Thanks for your feedback -- I fixed the sort order, and will try to reword the commit description as suggested. On 13/09/2025 22:55, Kristoffer Haugsbakk wrote: >> + advise_if_enabled( >> + ADVICE_BRANCH_USED_IN_OTHER_WORKTREE, >> + _("Use --detach to avoid this restriction,\n" >> + "or --ignore-other-worktrees to ignore it.")); > > I don’t know if `--detach` will “avoid” the restriction. (In fact > `--ignore-other-worktrees` might be the one that *avoids* it (turns it > off)?) > > Technically the only point of being-on-a-branch is to be able to advance > it. You know that. But does the advice-receiver? Because they might > use the hint to get what they want immediately. Then later wonder why > all the work they did on the branch “had no effect”. In my in-progress version of the patch, the reworded advice is as follows: fatal: 'foo' is already used by worktree at '/home/gasche/Prog/foo' hint: If you want to proceed anyway, try again with --ignore-other-worktrees. hint: Changes to the branch will also impact the other worktrees. hint: hint: If you want to detach HEAD at that branch, try again with the --detach option. (The last part is shown when ADVICE_SUGGEST_DETACHING_HEAD is enabled, and reuses the existing wording for that advice.)