fix(file_history): colour commits by remote reachability#177
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves file-history subject colouring by distinguishing pushed vs unpushed commits based on remote reachability (not just remote-tip decorations), and updates rendering/docs/tests to match.
Changes:
- Replace
LogEntry.has_remote_refwithLogEntry.is_pushed, with a decoration-based fallback when reachability isn’t provided. - Add Git adapter logic to precompute a “pushed commit set” via
git rev-list --remotes …(including rename-aware extension for--follow/ line-trace rename detection). - Update file-history rendering to layer selection highlighting over the pushed/unpushed base highlight, and extend functional tests + docs accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
lua/diffview/vcs/log_entry.lua |
Renames/repurposes the commit push-state flag and adds a fallback inference path. |
lua/diffview/vcs/adapters/git/init.lua |
Computes/extends a pushed commit set and passes is_pushed into LogEntry construction. |
lua/diffview/scene/views/file_history/render.lua |
Uses is_pushed for ref-aware subject highlighting and layers selection highlight via add_hl(). |
lua/diffview/tests/functional/git_adapter_spec.lua |
Adds functional coverage for pushed-set computation and rename-based extension/idempotency. |
lua/diffview/tests/functional/file_history_render_spec.lua |
Updates subject highlight tests and validates layered selection highlight behavior. |
doc/diffview.txt |
Documents the new pushed/unpushed semantics and the layered selection highlight behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2d3fbe9 to
2e23bcf
Compare
2e23bcf to
b28f683
Compare
b28f683 to
5cced8f
Compare
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.
Fixes #175.