feat: configuration for default branch#81
feat: configuration for default branch#81antonio-ivanovski wants to merge 2 commits intosatococoa:mainfrom
Conversation
📝 WalkthroughWalkthroughAdds a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Config as Config Loader
participant Builder as Worktree Builder
participant Git as Git Executor
User->>CLI: wtp add (no -b)
CLI->>Config: load .wtp.yml
Config-->>CLI: cfg (includes DefaultBranch?)
CLI->>Builder: buildWorktreeCommand(cfg, args)
alt DefaultBranch present
Builder->>Git: git worktree add ... <default_branch>
else No DefaultBranch
alt tracking resolved
Builder->>Git: git worktree add ... <resolved tracking>
else
Builder->>Git: git worktree add ... (no branch -> HEAD)
end
end
Git-->>User: worktree created
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
|
@antonio-ivanovski I want to keep wtp simple, so I’m cautious about adding new config options. With that in mind, could you share the motivation / concrete use case for this change? Since |
|
@satococoa To answer your question. My main use case for using worktrees is providing my coding agents their own worktree. This should almost always be from |
|
Thanks for the context — that makes sense. Given the goal of keeping wtp simple, I’d prefer not to add a new config option right now. As a practical workaround, could you have your coding agent use If this becomes a broader need beyond that workflow, I’m open to revisiting. |
Adds optional
defaults.default_branchin.wtp.ymlforwtp add -bso new worktrees can start from a configured branch when no commit is given; otherwise it still uses the currentHEAD.Summary by CodeRabbit
New Features
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.