Expand description
Domain model: the worktree row and its JSON schema (spec §7), plus the
sort and column enums used by list/status.
Worktree serializes to exactly the stable schema documented in §7. The
Option fields encode the spec’s null semantics: ahead/behind are
None (→ JSON null) when there is no upstream; the working-tree fields and
commit are None for a missing worktree; branch/slug are None for a
detached HEAD. None serializes as null (the fields are never omitted).
Structs§
- Commit
- Tip-commit metadata for display (spec §7).
- Pr
- A recorded pull request (spec §7).
- Removed
Result - The
removeresult object: the worktree row plus aremovedflag. - Sort
Spec - A sort field plus direction (spec §7; a
-prefix means descending). - Worktree
- One worktree row — the stable §7 JSON schema shared by
list,status, and thenew/pr/removeresult objects.
Enums§
- Column
- A
wt listdisplay column (spec §11list.columns). - Merge
State - How a branch’s commits relate to the rest of the repo, for delete-safety messaging in the TUI. Computed offline (no fetch): from ancestry against the base/default branch, a recorded merged PR, and whether the configured upstream’s tracking ref is gone.
- PrState
- Pull-request state, mirroring
gh(spec §7). - SortKey
- A field to sort
wt listby (spec §7--sort).
Constants§
- SCHEMA_
VERSION - The current
--jsonschema version (spec §7/§13). Bumped only on a breaking change so consumers can detect incompatibility.