Skip to content

feat: make worktree branch prefix configurable#889

Open
binbandit wants to merge 1 commit intopingdotgg:mainfrom
binbandit:t3code/settings-branch-prefix-default
Open

feat: make worktree branch prefix configurable#889
binbandit wants to merge 1 commit intopingdotgg:mainfrom
binbandit:t3code/settings-branch-prefix-default

Conversation

@binbandit
Copy link
Contributor

@binbandit binbandit commented Mar 11, 2026

Summary

  • add a persisted settings field for the worktree branch prefix, keeping t3code as the default
  • thread the configured prefix through new worktree creation and cross-repo PR worktree preparation
  • centralize branch-prefix normalization in shared git helpers and preserve the chosen prefix during first-turn auto-renames

Validation

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run vitest run packages/shared/src/git.test.ts packages/contracts/src/git.test.ts apps/server/src/git/Layers/GitManager.test.ts apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts
  • bun run vitest run apps/web/src/appSettings.test.ts apps/web/src/lib/gitReactQuery.test.ts

Note

Make worktree branch prefix configurable via app settings

  • Introduces DEFAULT_WORKTREE_BRANCH_PREFIX (t3code) and shared utilities (normalizeWorktreeBranchPrefix, buildGeneratedWorktreeBranchName, resolvePullRequestWorktreeLocalBranchName) in packages/shared/src/git.ts to centralize branch naming logic.
  • Adds a worktreeBranchPrefix field to app settings, normalized on save, so users can customize the prefix applied to temporary worktree and cross-repo PR branches.
  • Exposes a Git section in the settings UI (apps/web/src/routes/_chat.settings.tsx) with an input, example output, and a reset-to-default button.
  • Threads the configured prefix through ChatView, PullRequestThreadDialog, and preparePullRequestThread API contract so all branch creation paths use the user's prefix.
  • Behavioral Change: existing worktree branches created with the old hardcoded prefix (t3code) remain unchanged, but new branches will use whatever prefix the user has configured.

Macroscope summarized 9b27f32.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4b19a921-3682-44d6-abd1-c8960ad3139a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant