Skip to content

Let users override the new worktree's name and parent directory#351

Merged
sbertix merged 1 commit into
mainfrom
sbertix/303-worktree-options
May 22, 2026
Merged

Let users override the new worktree's name and parent directory#351
sbertix merged 1 commit into
mainfrom
sbertix/303-worktree-options

Conversation

@sbertix
Copy link
Copy Markdown
Collaborator

@sbertix sbertix commented May 22, 2026

Adds control over where a new worktree lands and what its folder is called, both in the New Worktree dialog and from the CLI / deeplinks.

Dialog

A default-collapsed "Advanced" section with two optional fields:

  • Worktree name — the folder name. Placeholder is the computed default (the branch name).
  • Parent folder — the directory the folder is created in. Placeholder is the resolved default base.

Leaving both empty preserves the existing base/<branch> placement exactly. The first section's footer shows the full resolved destination path, or the validation error when one is present.

CLI and deeplinks

  • supacode repo worktree-new gains --name <folder> and --location <dir>.
  • The supacode://repo/<id>/worktree/new deeplink gains name and location query params.

Behavior

  • The folder-name override is a single leaf, so slashes, dot segments, and .git are rejected with an inline message. The check runs in the shared create path, so the CLI and deeplink entry points are guarded the same way as the dialog.
  • The parent folder accepts absolute, ~-relative, and repo-relative paths.
  • Overrides are threaded to wt sw --path, leaving the branch as the positional argument, so the sidebar name still tracks the branch.

Close #303

Add a default-collapsed "Advanced" section to the New Worktree dialog with
two optional overrides: the worktree folder name (placeholder is the
computed name, the branch name) and the parent directory it is created in
(placeholder is the resolved default base). Both empty keeps the default
`base/<branch>` placement. The first section's footer shows the full
resolved destination path, or the validation error when one is present.

The same overrides are available outside the dialog: `supacode repo
worktree-new` gains `--name` / `--location`, and the
`repo/<id>/worktree/new` deeplink gains `name` / `location` query params.

The folder-name override is a single leaf, so slashes, dot segments, and
`.git` are rejected with an inline message; the check runs in the shared
create path so the CLI and deeplink entry points are guarded too. Overrides
flow through to `wt sw --path`, leaving the branch as the positional
argument so the sidebar name still tracks the branch.
@sbertix sbertix enabled auto-merge (squash) May 22, 2026 20:46
@tuist
Copy link
Copy Markdown

tuist Bot commented May 22, 2026

🛠️ Tuist Run Report 🛠️

Builds 🔨

Scheme Status Duration Commit
supacode 2m 17s 7a482762a

@sbertix sbertix merged commit 4abbe94 into main May 22, 2026
2 checks passed
@sbertix sbertix deleted the sbertix/303-worktree-options branch May 22, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More control over worktree naming/placement?

1 participant