Repository navigation
feat(config): list all aliases when wt config alias show has no name - #2684
Merged
Merged
Conversation
`wt config alias show <name>` shows one alias's template; with no name it now prints the same `Aliases:` block `wt --help` renders (name, source, one-line summary), reusing `render_aliases_section` / `load_aliases_for_listing` rather than duplicating. `name` becomes optional with a single internal branch — no `--list` flag. Tolerates running outside a repo or config; prints `No aliases configured` when empty. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
worktrunk-bot
approved these changes
May 11, 2026
max-sixty
added a commit
that referenced
this pull request
May 11, 2026
The `Aliases:` section in `wt --help` / `wt step --help` printed each alias's command template verbatim. Long one-liners (e.g. a `landed = "wt up && wt hook post-merge; git merge ..."`) wrapped mid-token in an 80-column terminal and made the section look broken. `wt --help` now shows just the alias names — deduped when the same name is defined in both user and project config, with shadowed-by-builtin still flagged inline — and points to `wt config alias show` for the full listing: ``` Aliases: landed, list (shadowed by built-in), sw, up Run wt config alias show for the full definitions. ``` The detailed per-alias listing (`name command-summary (source)`) stays in `render_aliases_section`, which `wt config alias show` (no argument) reuses after #2684 — so `--help` is the compact orientation view and `wt config alias show` is the inspection view. A new `render_aliases_help_section` produces the compact form. While in there: each styled name ends with a full reset (`\e[0m`), and the name list ends with a trailing space. The markdown pass over the spliced help text (`wrap_styled_text`) strips the `\e[39m` that `cformat!`'s `</>` emits and drops a reset that ends a line, so without these the last name's color bled onto the "Run …" sentence below. This also matches how clap closes each `Commands:` entry. Merged `main` (which landed #2684's `wt config alias show` no-arg listing) and resolved the overlap in `src/commands/alias.rs`. --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
2 tasks done
max-sixty
added a commit
that referenced
this pull request
May 11, 2026
## Summary `wt config alias show` with no name showed a compact one-line summary listing (the `name command-summary (source)` table added in #2684). This swaps it for the full per-alias view: the same `○ Alias <name> (<source>):` header + gutter block that `wt config alias show <name>` prints, emitted for every configured alias in name order (user entry before project when a name is defined in both), with the shadowed-by-built-in stderr warning preserved (once per name). `--help` / `wt step --help` keep the compact names-only `Aliases:` section and point here. ``` ○ Alias landed (user): wt up && wt hook post-merge; git merge {{ default_branch }} --no-edit && { git diff {{ default_branch }} --quiet && git reset {{ default_branch }}; :; } ○ Alias sw (user): wt switch {{ args }} ○ Alias up (user): git fetch --all --prune && wt step for-each -- sh -c ' ... ' ``` Also drops the blank line between consecutive `format_entry` blocks — applied consistently to `wt config alias show` (the new listing), `wt config alias show <name>` (had a blank line between the user and project entries when a name is in both configs), and `wt config alias dry-run <name>` (same). The `○ Alias …` header is the delimiter everywhere. The compact-summary renderer (`render_aliases_section` + `format_alias_summary`) and its unit tests are removed — only #2684's no-arg listing used them; `--help`'s names-only section is the separate `render_aliases_help_section`, which is untouched. ## Changes - `src/commands/config/alias.rs` — `list_aliases()` rewritten to emit `format_entry` per alias; `handle_alias_show` / `handle_alias_dry_run` drop the inter-entry blank line; docstrings + module doc updated. - `src/commands/alias.rs` — delete `render_aliases_section`, `format_alias_summary`, and their tests; tidy the `render_aliases_help_section` doc. - `src/cli/config.rs` — `wt config alias show` help text reflects the new behavior. - Docs (`docs/content/config.md`, skill mirror) regenerated; three snapshots updated (one content change + cosmetic env drift on two). ## Test plan - [x] `cargo run -- hook pre-merge --yes` — 3581 tests pass, all lints green - [x] Manual: `wt config alias show`, `wt config alias show <name>`, `wt config alias dry-run`, `wt config alias show --help` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
Merged
max-sixty
added a commit
that referenced
this pull request
May 13, 2026
Release v0.50.0. Highlights: - Experimental Azure DevOps support (#1256, thanks @mikeyroush; fixes #1144 from @dlecan) — `wt switch pr:<N>`, `wt list --full`, and `wt config show --full` recognize Azure DevOps via the `az` CLI. - Experimental Gitea CI-status detection (#2702) on top of the Gitea `pr:` shortcut (#1320, thanks @SjB). - Hooks now resolve `.config/wt.toml` from the worktree they act on — the primary-worktree fallback is gone, and `post-remove` reads the removed worktree's config (snapshotted before removal). Approval prompts collect hook commands from the same worktree. Breaking change for setups that relied on the primary-worktree fallback; the changelog entry has the recovery action. (#2690, #2703, #2714, #2717, #2701, #2708, #2727, #2736, #2748) - The `wt switch` picker's `alt-r` removal no longer runs unapproved project hooks (#2746) — the picker's removal path is now routed through `handle_remove_output` and consults the existing approval state read-only. - `wt config alias show` with no name lists every alias's full definition (#2684, #2691); `wt --help` switches to a compact aliases pointer (#2688). - `wt list --branches` warm-run perf: SHA-keyed cache for `main↕` and `Remote⇅` ahead/behind counts; shared push-remote URL and local-branch scan (#2704, #2718, #2673). - Claude Code plugin ships the `wt-switch-create` skill (#2737, thanks @onetom for #2631). See `CHANGELOG.md` for the full list (8 Improved, 5 Fixed, 5 Internal). semver-checks reports breaking library-API changes (new enum variants without `#[non_exhaustive]`, removed `Branch::github_push_url`, new trait method on `RemoteRefProvider`), which mandates at minimum a minor bump pre-1.0.
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.
wt config alias show <name>shows one alias's configured template. With no name it now lists every configured alias — the sameAliases:blockwt --helprenders (name, source, one-line summary). This is the receiving end of a separate change that replaces the inline aliases block inwt --helpwith a pointer towt config alias show.Implementation:
namebecomes optional with a single internal branch — no--listor--allflag. The listing reusesrender_aliases_section/load_aliases_for_listingfromcommands/alias.rs(promoted topub(crate)) rather than duplicating. It tolerates running outside a repo (user-config aliases still list, project-config ones are skipped) or outside a config, printsNo aliases configuredwhen empty, and pages likewt hook show. Top-level shadowing is annotated (list→(shadowed by built-in)).Audit of other
show/view/info/printsubcommands found nothing else to change:wt hook show [TYPE]already does this,wt config show/wt config shell show-theme/wt config state gettake no positional and already show everything, and noview/info/printsubcommands exist.Help text and the auto-synced docs/skill reference are updated; new snapshot tests cover the populated and empty listings, and the four
config_alias_show_unknown_*snapshots pick up theUsage: ... [NAME]change.