Skip to content

docs(config): correct two docstrings naming retired template variables - #4139

Merged
max-sixty merged 2 commits into
mainfrom
fix/issue-2984-stale-template-var-docs
Sep 16, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/issue-2984-stale-template-var-docs

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Requested by @max-sixty in #2984 (comment) — "fix those references, add a TODO to remove the vars in 3 months".

#4080 stopped supplying the retired template variables to any renderer and moved their renames into the load-path deprecation layer. Two docstrings still described the old behavior, and there was no record of when the rename rows themselves can go.

Comment fixes

TODO on RETIRED_VARS

Dates the removal at 2026-12-16, three months on from #4080, and records the constraint that makes the rows non-uniform: dropping a row stops the rename, so the old name has to fail loudly on its own first. A hook, alias, or worktree-path template already does, through SemiStrict expansion — but commits renders under minijinja's Lenient, which iterates an undefined value as an empty sequence, so dropping that row alone would silently empty a squash prompt's commit list. That row can only go once build_prompt rejects the name itself, which is the open question on #2984.

Comments only — no behavior change, no CHANGELOG.md entry. cargo clippy --lib --all-features, cargo fmt --check, and cargo test --lib config:: (550 tests) pass locally.

worktrunk-bot and others added 2 commits September 16, 2026 17:43
#4080 stopped supplying `main_worktree`, `worktree`, `repo_root`,
`main_worktree_path`, and `commits` to any renderer, but two docstrings
still offered the old names:

- `format_path`'s argument doc said `main_worktree` "supplies both
  `{{ main_worktree }}` and `{{ repo }}`". The `vars.insert("main_worktree", …)`
  line went with #4080; only `repo` is supplied now.
- `Command::template` offered `{{ worktree }}` as an example variable;
  it is retired to `worktree_path`.

Also adds a TODO on `RETIRED_VARS` recording when the rename rows can be
dropped, and what has to be true of `commits` first.

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test (macos) is red at this head, from an environment flake rather than
anything in the diff: test_bash_shell_integration_hint_suppressed captured
bash: child setpgid (63460 to 63460): Operation not permitted as an extra
line in its PTY snapshot. That is the macOS runner's job-control behavior
leaking into the captured session, and this PR changes only doc comments, so
it cannot reach that test. Rerunning the job.

No findings on the change itself — I checked each claim the new prose makes
against the code it describes, including that build_prompt is still the only
user-template surface rendering under minijinja's default Lenient
(wt list custom columns look Lenient-adjacent but validate_list_column_template
rejects an unknown name at resolution and aborts the command).

@max-sixty
max-sixty merged commit adb738c into main Sep 16, 2026
46 of 47 checks passed
@max-sixty
max-sixty deleted the fix/issue-2984-stale-template-var-docs branch September 16, 2026 19:24
max-sixty added a commit that referenced this pull request Sep 16, 2026
Brings in #4141 (template variables migrate through MiniJinja's parser),
#4140 (refuse to write a config rewrite that is not valid TOML), #4145
(report ignored project-config keys from every worktree), #4139, #4137.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Sep 16, 2026
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.

2 participants