Skip to content

Unify var and cache into state subcommand#178

Merged
max-sixty merged 1 commit intomainfrom
default-branch-set
Dec 12, 2025
Merged

Unify var and cache into state subcommand#178
max-sixty merged 1 commit intomainfrom
default-branch-set

Conversation

@max-sixty
Copy link
Owner

Summary

  • Replaces wt config var and wt config cache with unified wt config state subcommand
  • Uses key-first CLI structure where each key has only its valid flags (type-safe at parse time)
  • Adds ability to manually set/clear default branch via git remote set-head
  • Reuses format_relative_time_short for age formatting in logs

Test plan

  • All 198 unit tests pass
  • All 132 bin tests pass
  • All 25 config_state integration tests pass
  • All 27 help snapshot tests pass
  • Documentation auto-regenerated via test_command_pages_are_in_sync

🤖 Generated with Claude Code

Replace `wt config var` and `wt config cache` with a unified `wt config state`
subcommand that provides consistent get/set/clear semantics for all runtime
state.

New CLI structure uses key-first subcommands:
- `wt config state default-branch get [--refresh]`
- `wt config state default-branch set <branch>`
- `wt config state default-branch clear`
- `wt config state ci-status get [--refresh] [--branch=X]`
- `wt config state ci-status clear [--branch=X | --all]`
- `wt config state marker get [--branch=X]`
- `wt config state marker set <value> [--branch=X]`
- `wt config state marker clear [--branch=X | --all]`
- `wt config state logs get`
- `wt config state logs clear`
- `wt config state show`

Key changes:
- Added ability to manually set/clear default branch
- Each key is a subcommand with only its valid flags (type-safe at parse time)
- Removed runtime validation since clap handles invalid combinations
- Reuse format_relative_time_short for age formatting in logs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty merged commit 4ad3d4e into main Dec 12, 2025
17 of 18 checks passed
@max-sixty max-sixty deleted the default-branch-set branch December 12, 2025 10:04
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.

1 participant