Open
Description
it would be nice if bootstrap could auto-detect when it's being run from a git worktree and share
- the git submodule history, so it doesn't have to be refetched from the network bootstrap: Improve the UX when run from a git worktree #77621 (comment)
- the config.toml from the original worktree bootstrap: Improve the UX when run from a git worktree #77621 (comment)
original issue description
It should look something like this behind the scenes:
$ x.py setup --worktree ../rustc2
Setting up a new worktree at `/home/joshua/rustc2` # runs `git worktree add ../rustc2`
# all the current prompts, but config.toml is written to rustc2 instead of the current directory
# does *not* suggest to set up a git hook
This would make https://rustc-dev-guide.rust-lang.org/building/suggested.html?highlight=worktree#working-on-multiple-branches-at-the-same-time a lot more discoverable.
It should also use the submodule suggestions from https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/script.20to.20quickly.20generate.20complete.20git.20worktree (cc @lzutao), which would prevent cloning llvm more than once.
This would help work around #77620.