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 17, 2025, 15:25 UTC
Message-ID
<a27a8191-55d7-4b60-ad90-59ab946340bd@inria.fr>
In-Reply-To
<0dfe3e31-5486-446e-8af5-20669c06ea64@inria.fr>
Dear git developers,
On 15/09/2025 21:52, Gabriel Scherer wrote:
> (This gets me to wonder if a desirable behavior could be to 'detach' the other worktrees that had the same branch checked out, instead of failing on checkout. Users starting to use the other worktree again would possibly notice more quickly that something is amiss.)

After the new feedback from Junio, I wonder if I should explore this suggestion more actively.

For now my goal has been to make --ignore-other-worktrees more discoverable, for people who are willing to take the risk. (I am comfortable doing this as I have used this workflow for years without much trouble with the 'workdir' script, but clearly you want to be very careful in how exactly we suggest that it is a possibility.)

Would you prefer a different option to detach the branch at the other 
worktrees? This could be
   git checkout --detach-other-worktrees <branch>
for example.

I did not originally consider this as it requires more expertise in git internal data structures, but it may be easier than finding a way to advertise --ignore-other-worktrees that you are really comfortable with.

Previous: Junio C HamanoNext: Phillip Wood
Message 9 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.