Skip to content

Support structured names and improve completion for t() - #68

Merged
nnutter merged 7 commits into
masterfrom
structured-names
Sep 25, 2026
Merged

nnutter merged 7 commits into
masterfrom
structured-names

Conversation

@nnutter

@nnutter nnutter commented Sep 25, 2026

Copy link
Copy Markdown
Owner

No description provided.

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
@nnutter
nnutter enabled auto-merge September 25, 2026 23:07
@nnutter
nnutter merged commit d6c85af into master Sep 25, 2026
1 check passed
@nnutter
nnutter deleted the structured-names branch September 25, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant