Add wt.branchprefix config to decouple branch names from worktree directory names#171
Closed
glasser wants to merge 1 commit into
Closed
Add wt.branchprefix config to decouple branch names from worktree directory names#171glasser wants to merge 1 commit into
glasser wants to merge 1 commit into
Conversation
…ectory names When wt.branchprefix is set (e.g., "username/"), new branches are created with the prefix prepended (e.g., "username/my-feature") while the worktree directory uses the short name (e.g., ".wt/my-feature"). Key behaviors: - Existing branches matching the exact input are used as-is (no prefix added) - Input already starting with the prefix is not doubled - Worktrees can be found by either the short dir name or the full branch name - Supports both git config and --branchprefix flag override Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
|
Thank you for the well-crafted PR with thorough tests and documentation! After consideration, I've decided not to merge this feature for the following reasons.
I appreciate the contribution and the time you put into this. Feel free to open an issue if you'd like to discuss alternative approaches. |
Contributor
Author
|
That's fair. I think a simpler approach would just be to allow git wt in branch-creation mode take the branch and directory name as separate arguments? Then I can wrap it if I'd like with something that matches my personal standard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wt.branchprefixconfig option (and--branchprefixflag) that prepends a prefix to branch names when creating new branches, while keeping the worktree directory name shortgit config wt.branchprefix "username/",git wt foocreates branchusername/fooin directory.wt/foogit wt mainstill works naturallyTest plan
go test ./...)🤖 Generated with Claude Code