Repository navigation
feat: allow custom worktree branch names - #6454
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds branch-name override handling to the composer flow. The renderer now shows an advanced branch-name field, shared selection logic reconciles manual branch edits with push-target state, and the main-process worktree conflict messages and tests now use branch-name wording for branch collisions. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/NewWorkspaceComposerCard.tsx (1)
888-911: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: the extra
advancedOpenguard makes this field behave differently from its siblings.The Name/Note/Setup fields render unconditionally inside the collapsing drawer (which already sets
aria-hidden={!advancedOpen}), so they stay mounted and animate. Gating the branch-name field onadvancedOpenunmounts it on collapse and reveals it instantly (no grid-rows animation) on expand. DroppingadvancedOpenfrom the condition keeps it consistent with the surrounding fields.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4dcc2024-90b2-4afa-a253-4967cd46dd98
📥 Commits
Reviewing files that changed from the base of the PR and between 85d626b and 15bbb07122dea6d4e072dd93de3bbb69f43e9656.
📒 Files selected for processing (15)
src/main/ipc/workspace-create-error-classifier.test.tssrc/main/ipc/worktree-remote.tssrc/main/ipc/worktrees.test.tssrc/renderer/src/components/NewWorkspaceComposerCard.test.tsxsrc/renderer/src/components/NewWorkspaceComposerCard.tsxsrc/renderer/src/hooks/composer-branch-selection.test.tssrc/renderer/src/hooks/composer-branch-selection.tssrc/renderer/src/hooks/useComposerState-host-context-boundaries.test.tssrc/renderer/src/hooks/useComposerState.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/composer-branch-selection.ts
|
Resolved: removed the |
d6b7504 to
00e0547
Compare
|
will try to merge today! Sorry for delay |
…dvanced container
…s the branch A tracked PR/issue/MR/Linear source derives the branch itself, and a linked GitHub PR re-resolves the branch name at submit — so an override typed in the Advanced branch field was silently ignored. Only render the field for the typed-name and base-branch flows, where the manual override is honored. Co-authored-by: Orca <[email protected]>
Maintainer takeover — rebased, reviewed, verified end-to-endA maintainer has taken ownership of this PR: rebased onto latest Description (what this ships)An Advanced → "Branch name" field in the worktree-creation composer that lets you set the exact Git branch name instead of accepting the auto-derived slug. It reuses the existing
Is this already on Security — branch name → git command (safe)The typed name becomes a real Git ref, so I traced it end-to-end. It is safe:
Evidence (verified in a real Orca dev build)
Review fix I applied (1 finding)An independent review found the always-visible field was an editable-but-silently-ignored control when a GitHub PR was the source: a linked PR re-resolves its own branch at submit (and the base is resolved lazily from that selection), so a typed override was dropped. I gated the field to the typed-name and base-branch flows — where the override is actually honored — and hid it when a tracked work item (PR/issue/MR/Linear) drives the branch. Added 2 tests for the gating. (Clearing the PR start-point ref instead would have silently dropped the PR base, so hiding is the safe minimal fix.) I also finished the rebase conflicts: kept Trade-offs
ELI5Orca used to name your Git branch for you by squishing your workspace name into hyphens. Now there's a "Branch name" box: type the exact branch you want (e.g. |
DescriptionImplements #6414 — you can now customize the Git branch name when creating a worktree, independent of the workspace/directory name. A new optional "Branch name" field appears under Advanced in the Create-worktree composer. Whatever you type there becomes the actual Git branch ( This integrates cleanly with the existing composer rather than duplicating it:
The branch string flows through the pre-existing The branch was rebased onto EvidenceEnd-to-end in a real Electron dev build (fork PRs have no CI, so this dev build also served as the compile check — it built and ran clean):
Unit tests — 70/70 pass (re-run on the rebased branch): Lint clean ( Security: the typed name reaches git only as an argv token to ELI5When you make a new workspace, Orca creates a Git branch for it. Before, the branch was always named after the workspace folder. Now there's an optional box where you can type exactly what you want the branch to be called — like Trade-offs
(Screenshots are attached to this PR conversation, not committed to the branch.) |
|
Merged! 🎉 Thank you, @wolfiesch — this is live on Being able to type your own branch name when spinning up a worktree is one of those small things people ask for all the time, and it's genuinely nicer to use. Two things I really appreciated: how cleanly it dropped into the existing composer, and the thoughtful touch of hiding the manual field when a linked PR/issue is already driving the branch name — that's exactly the kind of detail that keeps the flow from getting confusing. Thanks too for sticking with it through the review round-trips (including that For transparency: I rebased onto latest Thanks again for making Orca a little better. 🙌 |
* feat: allow custom worktree branch names * refactor(ui): render custom branch name field unconditionally under advanced container * fix(composer): hide manual branch field when a work-item source drives the branch A tracked PR/issue/MR/Linear source derives the branch itself, and a linked GitHub PR re-resolves the branch name at submit — so an override typed in the Advanced branch field was silently ignored. Only render the field for the typed-name and base-branch flows, where the manual override is honored. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Wolfgang Schoenberger <[email protected]> Co-authored-by: Neil <[email protected]> Co-authored-by: Orca <[email protected]>
Summary
Adds an Advanced
Branch namefield to Git worktree creation so users can create an Orca worktree with an explicit Git branch name instead of accepting the generated branch slug.The field reuses the existing
branchNameOverridecreate path, so local and SSH/runtime worktree creation keep the same Git validation and conflict handling. Manual branch edits also clear stale PR/MR push-target and branch-reuse state when the chosen branch no longer matches the selected review branch.Fixes #6414
Screenshots
Testing
pnpm lint- passed with an existinguseGitStatusPolling.tsexhaustive-deps warning.pnpm run typecheckpnpm test- attempted; failed on existing environment-sensitive tests unrelated to this change (localStoragehelpers unavailable in several renderer tests, git prompt env expectation, repo remote URL expectation, and gitleaks output in a relay commit test).pnpm test src/renderer/src/hooks/composer-branch-selection.test.ts src/renderer/src/components/NewWorkspaceComposerCard.test.tsx src/renderer/src/hooks/useComposerState-host-context-boundaries.test.ts src/main/ipc/worktrees.test.ts src/main/ipc/workspace-create-error-classifier.test.tspnpm run build:desktop- passed with existing chunk-size warnings and a non-fatal/usr/local/bin/orca-devsymlink permission notice.AI Review Report
Reviewed the branch-name create flow across renderer state, existing
branchNameOverrideplumbing, local/SSH backend creation, and conflict copy.Findings addressed during review:
pushTargetand fork warnings when manual branch input no longer matches the selected review branch.id/htmlForwiring for the new field.Cross-platform: no keyboard shortcuts, shell interpolation, or path separators added. Branch validation remains in Git via argv-style
check-ref-format, and the existing local/SSH worktree create paths are reused.Security Audit
Manual branch input is passed through existing
branchNameOverridevalidation instead of being shell-interpolated. Git rejects invalid branch names throughcheck-ref-format; conflicts still stop exact branch overrides instead of silently suffixing them. No auth, secrets, dependency, network, or IPC surface changes beyond the existing create payload field.Notes