Skip to content

docs(switch): document why only switch needs pre-flight template validation - #1504

Merged
max-sixty merged 1 commit into
mainfrom
validate-other-cmds
Mar 14, 2026
Merged

max-sixty merged 1 commit into
mainfrom
validate-other-cmds

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Investigated whether other commands beyond switch would benefit from the pre-flight template validation added in #1500. Checked every command that expands templates: merge, remove, hook, for-each, alias, list.

Switch is the only command where template failure after mutation creates a blocking half-state — the worktree exists but the same wt switch -c <branch> can't be re-run. Other commands either run hooks before the irreversible operation (so errors abort cleanly) or after it completed (so failure is a missed notification, not a blocking state).

Added a doc comment on validate_switch_templates documenting this analysis.

This was written by Claude Code on behalf of max-sixty

…dation

After investigating all commands that expand templates (merge, remove, hook,
for-each, alias, list), switch is the only one where template failure after
mutation creates a blocking half-state — the worktree exists but the same
command can't be re-run.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit 5131917 into main Mar 14, 2026
23 checks passed
@max-sixty
max-sixty deleted the validate-other-cmds branch March 14, 2026 04:00
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