Commit 14df718
authored
feat(core): git_branch dirty counts mode with per-category colors (#25)
Add a `dirty.format = "counts"` rendering for git_branch that shows
per-category file counts (`main +3 ~2 ?1`) in place of the blunt `*`,
each color-coded: staged green, unstaged yellow, untracked red, with
configurable staged_icon/unstaged_icon/untracked_icon and count_hide_zero.
- GitContext::dirty_counts(): full gix combined-iterator scan on a
dedicated OnceCell, tallying staged (HEAD↔index) / unstaged / untracked.
- Counts render as styled spans via RenderedSegment::from_spans.
- Indicator early-exit path and its <20ms budget left untouched; counts
is opt-in.
The counts cell is separate from the indicator dirty() cell so an
indicator-mode read can't poison a later counts read with a count-less
Dirty(None). gix 0.83's combined iterator detects staged HEAD↔index
changes, so the old gix-0.67 staged-count caveat no longer applies.
Per-item scan errors are best-effort (skip, don't fail the scan closed
to Clean) to avoid rendering a dirty repo as clean.
lsm-hwm01 parent 2d122ba commit 14df718
4 files changed
Lines changed: 692 additions & 86 deletions
File tree
- .beads
- crates/linesmith-core/src
- data_context
- segments
- docs/specs
0 commit comments