git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Caleb White <cdwhite3@pm.me>
To: Caleb White <cdwhite3@pm.me>, git@vger.kernel.org
Subject: Re: [PATCH 0/2] Ensure unique worktree ids across repositories
Date: Fri, 29 Nov 2024 02:49:32 +0000	[thread overview]
Message-ID: <D5YBJRUXYLUR.8TB0DXCJ6654@pm.me> (raw)
In-Reply-To: <20241128-wt_unique_ids-v1-0-30345d010e43@pm.me>

On Thu Nov 28, 2024 at 8:44 PM CST, Caleb White wrote:
> The `es/worktree-repair-copied` topic added support for repairing a
> worktree from a copy scenario. I noted[1,2] that the topic added the
> ability for a repository to "take over" a worktree from another
> repository if the worktree_id matched a worktree inside the current
> repository which can happen if two repositories use the same worktree name.
>
> This series teaches Git to create worktrees with a unique suffix so
> that the worktree_id is unique across all repositories even if they have
> the same name. For example creating a worktree `develop` would look like:
>
>     foo/
>     ├── .git/worktrees/develop-5445874156/
>     └── develop/
>     bar/
>     ├── .git/worktrees/develop-1549518426/
>     └── develop/
>
> The actual worktree directory name is still `develop`, but the
> worktree_id is unique and prevents the "take over" scenario. The suffix
> is given by the `git_rand()` function, but I'm open to suggestions if
> there's a better random or hashing function to use.
>
> [1]: https://lore.kernel.org/git/20241008153035.71178-1-cdwhite3@pm.me/
> [2]: https://lore.kernel.org/git/r4zmcET41Skr_FMop47AKd7cms9E8bKPSvHuAUpnYavzKEY6JybJta0_7GfuYB0q-gD-XNcvh5VDTfiT3qthGKjqhS1sbT4M2lUABynOz2Q=@pm.me/

I forgot to mention, but the base for this series is obtained by merging
the `cw/worktree-extension` topic (2024-11-26, 20241125-wt_relative_options-v5-0-356d122ff3db@pm.me)
onto 090d24e9af.

Best,

Caleb


  parent reply	other threads:[~2024-11-29  2:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29  2:44 [PATCH 0/2] Ensure unique worktree ids across repositories Caleb White
2024-11-29  2:44 ` [PATCH 1/2] worktree: add worktree with unique suffix Caleb White
2024-11-29  2:44 ` [PATCH 2/2] worktree: rename worktree id during worktree move Caleb White
2024-11-29  2:49 ` Caleb White [this message]
2024-11-29  3:14 ` [PATCH 0/2] Ensure unique worktree ids across repositories Junio C Hamano
2024-11-29  3:31   ` Caleb White
2024-12-01  4:38     ` Junio C Hamano
2024-11-29 11:05 ` shejialuo
2024-11-29 15:58   ` Caleb White
2024-11-29 17:32     ` shejialuo
2024-11-29 20:39       ` Caleb White

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D5YBJRUXYLUR.8TB0DXCJ6654@pm.me \
    --to=cdwhite3@pm.me \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).