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

Re: [PATCH 1/3] checkout: provide hint when failing due to another worktree

From
GSGabriel Scherer <gabriel.scherer@inria.fr>
Date
Sep 14, 2025, 07:50 UTC
Message-ID
<d44109a1-0ff5-49f8-885b-9aae195ec492@inria.fr>
In-Reply-To
<be510685-3be1-4f71-806a-6b580bb1cf21@app.fastmail.com>

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:
Show 13 quoted lines
>> +			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.)

Previous: Kristoffer HaugsbakkNext: Junio C Hamano
Message 4 of 20 in “extend --ignore-other-worktrees to 'rebase', add hints”
  1. 0/3 extend --ignore-other-worktrees to 'rebase', add hintsGabriel Scherer, Sep 13, 2025
  2. 1/3 checkout: provide hint when failing due to another worktreeGabriel Scherer, Sep 13, 2025
  3. Kristoffer HaugsbakkSep 13, 2025
  4. Gabriel SchererSep 14, 2025
  5. Junio C HamanoSep 15, 2025
  6. Gabriel SchererSep 15, 2025
  7. Junio C HamanoSep 16, 2025
  8. Junio C HamanoSep 17, 2025
  9. Gabriel SchererSep 17, 2025
  10. Phillip WoodSep 19, 2025
  11. Ben KnobleSep 14, 2025
  12. Ben KnobleSep 14, 2025
  13. Kristoffer HaugsbakkSep 14, 2025
  14. 2/3 rebase: support --ignore-other-worktreesGabriel Scherer, Sep 13, 2025
  15. Phillip WoodSep 15, 2025
  16. Junio C HamanoSep 15, 2025
  17. 3/3 rebase: hint when failing on branch used by another worktreeGabriel Scherer, Sep 13, 2025
  18. Ben KnobleSep 13, 2025
  19. Gabriel SchererSep 13, 2025
  20. Phillip WoodSep 15, 2025

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.