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

Re: [PATCH v2 0/3] Ensure unique worktree ids across repositories

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 3, 2024, 04:37 UTC
Message-ID
<xmqqiks1e5zs.fsf@gitster.g>
In-Reply-To
<D61R68MFWDIU.12PI8AA8S3G86@pm.me>
Caleb White <cdwhite3@pm.me> writes:
> You're correct in that the worktree ids are only relevant within the
> context of a single repository. However, I've already demonstrated that
> it's possible for a repository to "repair" (i.e., take over) a worktree
> belonging to another repository if the ids match (inferred backlink).

I know. But isn't that a BUG in the code that "repair"s? If a worktree had a name 'develop' that was OK in the context of repository X, and when you "repair" things so that it becomes one of the worktrees of a different repository Y, the "repair" operation is what MUST make sure that the worktree that used to be known as 'develop' to repository X does not interfere any existing worktrees that is attached to the repository Y. If the repository Y already had a worktree called 'develop', the "repair" operation must make sure that the newly adopted worktree would get a different name.

But then, the concern is exactly the same when you try to create a new worktree (no "repair" involved) in repository Y and try to give it a name 'develop', isn't it? You have to make sure that there is no worktree that is called 'develop' in the repository Y before giving it the name. Is it broken? If not, what are we doing to make sure we won't give the name 'develop' to the new worktree? Certainly we do not use any hash or random number for that, so why does this new series need to use a random number?

Previous: Caleb WhiteNext: Caleb White
Message 22 of 24 in “Ensure unique worktree ids across repositories”
  1. 0/3 Ensure unique worktree ids across repositoriesCaleb White, Nov 29, 2024
  2. 1/3 worktree: add worktree with unique suffixCaleb White, Nov 29, 2024
  3. 2/3 worktree: rename worktree id during worktree moveCaleb White, Nov 29, 2024
  4. 3/3 worktree: add id to `worktree list` outputCaleb White, Nov 29, 2024
  5. rsbecker@nexbridge.comNov 29, 2024
  6. Caleb WhiteNov 29, 2024
  7. rsbecker@nexbridge.comNov 29, 2024
  8. Caleb WhiteNov 29, 2024
  9. rsbecker@nexbridge.comNov 29, 2024
  10. Caleb WhiteNov 30, 2024
  11. rsbecker@nexbridge.comNov 30, 2024
  12. Caleb WhiteNov 30, 2024
  13. rsbecker@nexbridge.comNov 30, 2024
  14. Junio C HamanoDec 2, 2024
  15. shejialuoDec 2, 2024
  16. Junio C HamanoDec 3, 2024
  17. Eric SunshineDec 3, 2024
  18. Junio C HamanoDec 3, 2024
  19. rsbecker@nexbridge.comDec 3, 2024
  20. Junio C HamanoDec 3, 2024
  21. Caleb WhiteDec 3, 2024
  22. Junio C HamanoDec 3, 2024
  23. Caleb WhiteDec 3, 2024
  24. shejialuoDec 3, 2024

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.