Name the template owner in the -v variables block - #3495
Merged
Conversation
The `-v` variables table printed a bare `template variables:` header, so
nothing in it said which template the variables were for. The adjacent
blocks in the same lane already label themselves (`○ eval source`,
`○ user:noop result`), and the table only carried its owner incidentally —
in the `hook_type` row at the bottom of a ~20-row listing, or in the
`Running ...` line below it.
Background hooks made that ambiguous rather than just inconvenient:
`wt -v remove` prints one table per hook type back to back, then a single
combined `Running post-remove: cleanup; post-switch: notify` line, leaving
two identical headers above two tables that differ only in their rows.
Prefix each header with the hook type, alias name, or `eval`, matching the
sibling `source` / `result` headers. `wt step eval -v` now reads:
○ eval template variables:
○ eval source
○ eval result
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
max-sixty
marked this pull request as ready for review
July 17, 2026 04:27
worktrunk-bot
approved these changes
Jul 17, 2026
max-sixty
added a commit
that referenced
this pull request
Jul 22, 2026
`wt step eval -v` was the last of the four `-v` template-variable listings to hand-roll its own formatting. The hook (foreground + background) and alias sites all render through `format_hook_variables` / `format_alias_variables`; eval instead sorted keys alphabetically, padded, and joined them by hand. #3495 labelled all four block *headers* with their owner, which made eval's differently-formatted *body* stand out. This adds a sibling `format_base_variables` for the bare `base_vars` scope (no hook operation/infrastructure vars, no alias `args`) and routes eval through it, so all four listings are one family. Consequences for the eval listing, now matching the other three: - curated help-table order instead of alphabetical - deprecated aliases (`main_worktree`, `repo_root`, `worktree`, `main_worktree_path`) dropped, as the other sites already omit them - absent optional vars show `(unset)` (e.g. `owner` with no PR context) - variable names render plain, not bold Behavior-only change to the `-v` diagnostic lane; the `eval_verbose` / `eval_format_json_verbose` snapshots capture the new output. > _This was written by Claude Code on behalf of max_ Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 task
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.
The question
When
wtshows atemplate variables:block under-v, does it say which template the variables belong to? Mostly no — and in one case it genuinely can't be worked out from the header.What was there
Four sites print a variables listing, and none named its owner in the header:
command_executor.rs)template variables:hook_typerow at the bottom of the table, or theRunning …line below ithooks.rs)template variables:alias.rs)template variables:Running alias greetline below itwt step eval(eval.rs)Available template variablesThe adjacent blocks in the same
-vlane already label themselves —○ eval source,○ user:noop result— so the variables table was the odd one out in its own family.Background hooks turned that from inconvenient into ambiguous.
wt -v remove <branch>prints one table per hook type back to back, then a single combinedRunning post-remove: cleanup (user); post-switch: notify (user)line — two identical headers over two ~20-row tables that differ only in their rows.The change
Prefix each header with the hook type, alias name, or
eval.wt step eval -vnow reads as one labeled family:eval's header was reworded fromAvailable template variablesfor the same shape; it was never ambiguous, but it's the fourth member of the family and now matches thesource/resultheaders directly beneath it.Display-only — no logic changed. Snapshots and the generated
step.mdpages regenerated;cargo run -- hook pre-merge --yesgreen (4461 tests).🤖 Generated with Claude Code