Repository navigation
Support structured names and improve completion for t() - #68
Merged
Merged
Conversation
Introduce repoShortName for the final repo-name segment and use it in bare/worktree path helpers. Simple names behave identically; this prepares the path layout for structured names like nnutter/timber.
Accept slash-separated names like nnutter/timber. Bare repos live at repos/nnutter/timber.git and worktrees at <root>/nnutter/timber/<worktree>/timber, so the leaf keeps the short name. Discovery walks repos recursively and rename ensures nested destination parents.
GitHub URLs default to owner/repo and other hosted paths keep their full grouping; local paths still use the basename. This makes repo add nnutter/timber register the structured name directly.
Moving repos/nnutter/timber.git away leaves repos/nnutter behind; rename and remove now prune newly-empty bare parents up to the store. Worktree parents were already pruned to home. Git cannot move the bare itself, so rename keeps using git worktree repair to repoint checkouts.
List registrations with repos/**/*.git and derive slash-separated names so structured repos complete. Worktree checks use the short leaf name.
Explain the nested bare/worktree layout, the owner/repo default for repo add, rename between simple and structured names, and repo-sort grouping.
The generated _t completion hand-maintained every subcommand's flags and argument states, so it drifted from the Cobra definitions: list completed only --help, missing --pr, --json, and --sort. Generate a completion that calls 'command timber __complete' instead, so flags, subcommands, and argument completions always match the CLI. The wrapper-only create --no-cd flag, which timber itself does not define, is layered on top. Pty completion tests now build the current source and put it on PATH so the delegation is exercised end to end rather than against whatever timber happens to be installed. Reviewed-by: Nathan Nutter <nnutter@duck.com> Reviewed-at: dc7ef64ea49edbfc7194d6a8d4376621eea5dacd
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.
No description provided.