Repository navigation
Conversation
worktrunk-bot
left a comment
There was a problem hiding this comment.
Two points beyond the inline suggestions; the first is outside the diff.
squash_template's own doc comment still advertises the variable this PR removes. In src/config/user/sections.rs, the field documented as "Inline template for squash commit message prompt" carries /// Available variables: {{ commits }}, {{ target_branch }}, {{ branch }}, {{ repo }} immediately above #[serde(default, rename = "squash-template")]. That is the description schemars derives for the key and the first thing a reader of CommitGenerationConfig sees, so after this change it names the one variable that now hard-errors. One word (commit_details) fixes it — take it here, or say so and I'll push it.
The deprecation warning still calls commits "deprecated" while rendering now rejects it. The PR's own snapshot puts both lines in one run:
▲ User config: template variable commits is deprecated in favor of commit_details
↳ To see details, run wt config show; to apply updates, run wt config update
✗ Template commit.generation.squash-template uses removed variable commits; use commit_details (run wt config update)
The warning fires on every command that loads config, so a user who has not yet triggered a generation reads "deprecated in favor of" as "still works, migrate when convenient" — and then wt merge fails outright. DeprecationKind::TemplateVar is shared with four pairs that genuinely do still work at runtime (repo_root, worktree, …), so telling the retired one apart costs a payload on that variant or a separate kind. That cost is why this is a decision rather than a suggestion; the two lines contradicting each other in one terminal is the part worth deciding about.
| let (old, new) = RETIRED_COMMITS_VAR; | ||
| if template.undeclared_variables(false).contains(old) { | ||
| anyhow::bail!(cformat!( | ||
| "Template <bold>{location}</> uses removed variable <bold>{old}</>; use <bold>{new}</> (run <bold>wt config update</>)" |
There was a problem hiding this comment.
The recovery command lands inside a trailing parenthetical, so the closing paren sits against the string the user has to copy. .claude/skills/writing-user-outputs/SKILL.md gives the shape for this case — "Description + command in single message" (join with a semicolon, <bold> for the command in warnings/errors) and "End with the command for easy copying":
| "Template <bold>{location}</> uses removed variable <bold>{old}</>; use <bold>{new}</> (run <bold>wt config update</>)" | |
| "Template <bold>{location}</> uses removed variable <bold>{old}</>; replace it with <bold>{new}</>, or run <bold>wt config update</>" |
Four snapshots pin this string — three inline in src/llm.rs and the renamed …__step_squash_show_prompt_removed_commits_errors.snap — so this needs a cargo insta test --accept pass.
| Run `wt config update` to migrate existing configuration; a loop that prints each element directly keeps producing its subject. | ||
| This removal takes effect with the release containing it, not by checking the current date. Older binaries retain their previous behavior. |
There was a problem hiding this comment.
This line answers the issue's "after 2026-09-06" framing rather than a question a reader of the docs has: nothing in Worktrunk ever gated a template variable on the calendar, so "not by checking the current date" introduces a mechanism only to deny it, and "older binaries retain their previous behavior" is true of every change in every release. The two lines above it already carry what a user needs — what is gone and how to migrate.
| Run `wt config update` to migrate existing configuration; a loop that prints each element directly keeps producing its subject. | |
| This removal takes effect with the release containing it, not by checking the current date. Older binaries retain their previous behavior. | |
| Run `wt config update` to migrate existing configuration; a loop that prints each element directly keeps producing its subject. |
This page is the primary, so the two generated mirrors follow from cargo test --test integration test_docs_are_in_sync.
|
@worktrunk-bot can you implement this afresh? just remove the deprecated behavior |
|
Done — #4080 implements it afresh, with none of this PR's validation/error machinery. The removal is in the renderer: If you'd rather the old name stop resolving at all, that's now one line — deleting the |
Fixes #2984.
Changes
commitsvariable to commit/squash prompts and user/project append fragments. Parsed-template validation reports the affected setting,commit_details, andwt config update; literals, comments, local bindings, and unrelated variables remain unaffected.config show,config update, and unrelated commands can still work with an old config. The existing warning/update invariant and migration rule remain intact.CommitDetailValuerendering. Update the removal/recovery notes and generated help/config documentation. This implements the requested removal step, with no wall-clock check or reintroduction of the old name as an object alias.Validation
cargo run -- hook pre-merge --yes: 4,868 tests passed with all features; the existing nightly-only crate-archive build test remains ignored. Pre-commit/clippy, Rust documentation, and doctests passed.step squashandmergecalls that neither invoke the configured generator nor change branch refs, and a config-update/render/idempotence test.Linux validation used the pinned Rust 1.97 toolchain and Git 2.54.0, plus real bash/zsh/fish/Nushell/PowerShell test shells. The test process used the standard umask and dropped root's file-permission-bypass capabilities so the existing permission assertions were meaningful. The suite's explicit UID-based skips still apply. Native cross-platform CI is still separate from these local results.