Summary
When a branch name contains slashes (e.g., feature/my-thing, issue/fix-login), sanitize_branch_name() replaces / with -, producing a flat directory like worktrees/feature-my-thing. I'd like worktrees to preserve the slash as a directory separator instead, producing worktrees/feature/my-thing.
Context
Many teams use hierarchical branch naming conventions (feature/, issue/, hot-fix/, etc.). With the current behavior, all worktrees are dumped into a single flat directory regardless of branch prefix. Preserving the slash as a directory separator would allow natural grouping:
worktrees/
feature/
add-payments/
update-dashboard/
issue/
fix-login/
fix-timeout/
hot-fix/
critical-patch/
This makes it easier to navigate worktrees when you have many active branches, and it matches the hierarchical structure that git itself uses for refs.
Current behavior
$ awt issue/plugin-routes-not-registered
# Creates: worktrees/issue-plugin-routes-not-registered
Desired behavior
$ awt issue/plugin-routes-not-registered
# Creates: worktrees/issue/plugin-routes-not-registered
Notes
I notice that worktree.branch_name_sanitization_enabled and worktree.branch_name_sanitization_replacements were removed in v0.5.0 with the note "no one ever used these." If restoring and wiring up that config is the right path to solve this, I'd be in favor of that. But however it gets done, the core ask is just: let slashes in branch names become subdirectories in the worktree path.
Summary
When a branch name contains slashes (e.g.,
feature/my-thing,issue/fix-login),sanitize_branch_name()replaces/with-, producing a flat directory likeworktrees/feature-my-thing. I'd like worktrees to preserve the slash as a directory separator instead, producingworktrees/feature/my-thing.Context
Many teams use hierarchical branch naming conventions (
feature/,issue/,hot-fix/, etc.). With the current behavior, all worktrees are dumped into a single flat directory regardless of branch prefix. Preserving the slash as a directory separator would allow natural grouping:This makes it easier to navigate worktrees when you have many active branches, and it matches the hierarchical structure that git itself uses for refs.
Current behavior
Desired behavior
Notes
I notice that
worktree.branch_name_sanitization_enabledandworktree.branch_name_sanitization_replacementswere removed in v0.5.0 with the note "no one ever used these." If restoring and wiring up that config is the right path to solve this, I'd be in favor of that. But however it gets done, the core ask is just: let slashes in branch names become subdirectories in the worktree path.