✨ feat(cli): resolve repo context from worktrees directory#27
Merged
iamrajjoshi merged 1 commit intomainfrom Feb 15, 2026
Merged
✨ feat(cli): resolve repo context from worktrees directory#27iamrajjoshi merged 1 commit intomainfrom
iamrajjoshi merged 1 commit intomainfrom
Conversation
Commands like `ww ls`, `ww pwd`, `ww config`, `ww rm`, `ww run`, and `ww prune` now work when run from ~/.willow/worktrees/<name>/, not just from inside a specific worktree. This is more intuitive since users often cd into the repo's worktrees directory to browse branches.
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
ResolveRepoFromDirhelper that maps~/.willow/worktrees/<name>/to~/.willow/repos/<name>.gitrequireWillowRepo(used byrm,run,prune,pwd,init,config set/edit) to fall back to this resolutionls,config list,config get, and tab completion to also use the fallbackContext
Previously, commands only worked from inside a specific worktree (where
git rev-parse --git-common-dirsucceeds). Runningww lsfrom~/.willow/worktrees/evergreen/would fall through to listing all repos instead of showing that repo's worktrees. This was unintuitive since users oftencdinto the repo's worktrees directory to browse branches.Test plan
go build && go test ./...passesww lsfrom~/.willow/worktrees/evergreen/lists evergreen's worktreesww lsfrom/tmpstill shows the repo list