feat(log): add ref decoration and HEAD marking to the commit log - #10
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9.
Brings the orientation
git log --decorategives to the commit log view.src/git/diff/refs.rswalksrepo.references()once into anOid -> Vec<RefLabel>map, distinguishing HEAD / local branch / tag / remote branch by color (git's own--decoratepalette). Annotated tags peel to the commit they point at. Cost scales with the number of refs, not commits.↑ahead,vbehind) and shape (*HEAD,Ymerge), so rows stay column-aligned.i < ahead_countpositional 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 atMAX_DIVERGENCE_OIDS; the walk is newest-first, so the cap drops the tail no one scrolls to.area.width >= MIN_DETAIL_WIDTHthe row switches to absolute time, author plus email, 10-char short id, and untruncated chips. Keyed on width rather thanlist_fullscreen, matching thediff_viewer::MIN_SPLIT_WIDTHprecedent. One commit still equals one row; the extra room grows columns.origin/dev), soRepoSnapshotcarries 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.rswas split intocommit_list/{mod,row}.rsfirst, as a pure refactor, to stay under the 300-line limit.wall_clockgainedlocal_date_timefor 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.mdrecords that.Verification
cargo fmt --check,cargo clippy --all-targets --all-features -- -D warnings, andcargo test(1435 passed, 0 failed) all pass on the merge withupstream/dev.