Repository navigation
[Feature]: configurable worktree location #6719
Replies: 9 comments 1 reply
|
This would be very helpful especially on Windows because of two reasons:
|
|
#6975 proposes the same per-project worktree location with a literal path. It adds useful constraints: apply the setting server-side to desktop, mobile and PR-created threads, and allow the configured root in review/diff validation. Existing worktrees need not move. |
|
I had a go at this — #9681. Follows the constraints @juliusmarminge listed: the root is resolved server-side, so new worktree threads, PRs opened as threads and mobile all land in the same place, and existing worktrees stay where they are. One difference worth flagging — for review/diff validation I ended up authorizing the worktree path each thread recorded rather than the project's current configured root. Same effect, but it keeps working after you change the setting, and it avoids a root like @danielo515 your case works: set it to @mhabegger Windows drive and UNC paths work, and a root the hosting server can't read as absolute is ignored rather than resolved somewhere unexpected. First time contributing here so I'm not sure how you prefer to handle this — CONTRIBUTING says to discuss non-trivial changes first, which is why I'm posting rather than just leaving the PR sitting. CI also hasn't run on it; looks like it needs a maintainer to approve workflows for a first-time contributor. No expectations either way — happy for it to sit, or be closed if it's not a direction you want. |
|
@juliusmarminge — #9681 is rebased on current main and mergeable, if you ever want to look. It implements the constraints you listed here. CI hasn't run on it, so there's nothing green to judge it by — it needs the workflow approval first-time contributors need. Genuinely no pressure either way; happy to close it if it's not wanted. |
|
@juliusmarminge — #11747 implements your constraints: server-side placement for desktop, mobile and PR-created threads, working review/diff access, and no relocation of existing worktrees. Related implementation: #9681. This is still under review, not shipped.
direnv workaround: reuse the source checkout’s environmentWorktree placement is not the only option. For a normal non-bare checkout with a git_dir=$(git rev-parse --absolute-git-dir) || return 1
common_dir=$(git rev-parse --path-format=absolute --git-common-dir) || return 1
if [[ "$git_dir" != "$common_dir" && "${common_dir##*/}" == ".git" ]]; then
source_env "${common_dir%/.git}/.envrc"
else
# Your normal main-checkout environment setup, e.g.:
export PROJECT_ENV=development
fi
Review the file and run The Git-path logic was checked with a temporary repo and linked worktree, including paths with spaces. References: Git shared-directory lookup, direnv |
|
+1 for project-relative worktree locations. I use T3 Code locally on my laptop for both work and personal projects. My When T3 creates a worktree under The new absolute worktree-location setting helps, but one shared directory does not preserve different profiles for different projects. Even if T3 starts the correct provider instance, directory-based I'd like to configure This would preserve the existing profile rules without a separate absolute-path setting for every project. |
|
Also agree with this one. Some of my projects are very read-write intensive so I moved them to a separate external drive, while keeping pet projects at the main drive. By forcing all worktrees to a single location, I would need to either move everything back to the main drive, or always carry the external drive with me. This on top of things that are configured to manage the worktrees per project |
|
#16231 shipped an absolute Worktree location, so worktrees can now move to another drive. The ask of this discussion stays open: worktrees as children of the project folder. ProblemClaude Code creates T3 creates worktrees under The setting can't fix it for every project:
Proposed solutionAccept a location relative to the project root, resolved per project, for example Risks
|
|
+1 for project-relative locations, with a use case where the folder hierarchy above the project matters, not just the project folder itself. My projects are grouped in folders, and direnv loads a parent .envrc from each group (and from some intermediate folders) on the way down to a repo. For example:
A worktree only gets the right environment if it sits under the same group folder as its project. The absolute Worktree location from #16231 doesn't cover this: every worktree goes to Orca handles this with a relative workspace directory. I use I'd like the same in T3, with something like T3 Code 0.1.5 (Beta), macOS. |
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/web
Problem or use case
Hello. I currently have some requirements on some of my projects that doesn't allow me to put them in arbitrary locations. For example, the current location of the worktrees. I want them to be children of the main project folder so I can take advantage of all my local tools configured for that particular folder.
Proposed solution
I want a setting that I can adjust per project to tell where to create the worktrees, either in a global place or as children of the current worktree.
Why this matters
As I said I use tools that are folder-dependent to handle my available dependencies, and they will not be available if you put the worktree in some random place.
Smallest useful scope
All the people using direnv and flakes on parent directories and similar stuff
Alternatives considered
NOt using worktrees
Risks or tradeoffs
This will be backwards compatible
Examples or references
No response
Contribution
All reactions