Skip to content

feat(log): add ref decoration and HEAD marking to the commit log - #10

Merged
whaclaw-bot merged 16 commits into
code0xff:devfrom
whackur:dev
Jul 31, 2026
Merged

feat(log): add ref decoration and HEAD marking to the commit log#10
whaclaw-bot merged 16 commits into
code0xff:devfrom
whackur:dev

Conversation

@whaclaw-bot

Copy link
Copy Markdown
Collaborator

Closes #9.

Brings the orientation git log --decorate gives to the commit log view.

  • Ref decoration chipssrc/git/diff/refs.rs walks repo.references() once into an Oid -> Vec<RefLabel> map, distinguishing HEAD / local branch / tag / remote branch by color (git's own --decorate palette). Annotated tags peel to the commit they point at. Cost scales with the number of refs, not commits.
  • HEAD emphasis and merge glyph — two fixed glyph cells per row: divergence ( ahead, v behind) and shape (* HEAD, Y merge), so rows stay column-aligned.
  • Accurate ahead/behind — the old i < ahead_count positional assumption is gone. revwalk.push(local) + hide(upstream) (and the reverse) build oid sets tested by membership, so the markers stay correct under pagination and filtering. Each side is capped at MAX_DIVERGENCE_OIDS; the walk is newest-first, so the cap drops the tail no one scrolls to.
  • Width-threshold wide layout — at area.width >= MIN_DETAIL_WIDTH the row switches to absolute time, author plus email, 10-char short id, and untruncated chips. Keyed on width rather than list_fullscreen, matching the diff_viewer::MIN_SPLIT_WIDTH precedent. One commit still equals one row; the extra room grows columns.
  • Refresh gating — refs move without HEAD moving (a fetch advances origin/dev), so RepoSnapshot carries a refs fingerprint and the map is rebuilt only when it changes. A failed rebuild keeps the previous map rather than dropping chips on a transient error.

commit_list.rs was split into commit_list/{mod,row}.rs first, as a pure refactor, to stay under the 300-line limit.

wall_clock gained local_date_time for the absolute column — hand-rolled civil-from-days, consistent with that module's existing no-date-crate decision.

The commit graph stays out of scope, as the issue proposed: a lane graph presumes topological order, and changing the revwalk sort drags the anchor+skip pagination contract along with it. docs/architecture.md records that.

Verification

cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings, and cargo test (1435 passed, 0 failed) all pass on the merge with upstream/dev.

@whaclaw-bot
whaclaw-bot merged commit 02c29f3 into code0xff:dev Jul 31, 2026
5 checks passed
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.

feat(log): add ref decoration and HEAD marking to the commit log, detail columns on wide screens

2 participants