fix(gix-traverse): use graph painting for hide() to ensure correct behavior#2408
Merged
Sebastian Thiel (Byron) merged 4 commits intomainfrom Feb 4, 2026
Merged
Conversation
Copilot
AI
changed the title
[WIP] Add test to reproduce commit hiding issue in gix-traverse
fix(gix-traverse): use graph painting for hide() to ensure correct behavior
Feb 3, 2026
2e8fccf to
90bbd95
Compare
Member
|
This is terrible for performance, but it at least fixes the long-standing bug, something that should have been done a while ago. |
…havior The hide() function now fully traverses all hidden tips and marks all reachable commits as Hidden before returning. This "graph painting" approach ensures correct behavior regardless of graph topology or traversal order, matching git's behavior. Previously, hidden commits were traversed lazily during iteration, interleaved with interesting commits. While this worked in most cases, the new approach is simpler and more robust. Added tests to verify correct behavior when: - Hidden tip has longer path to shared ancestor - Interesting tip has longer path to shared ancestor Co-authored-by: Byron <[email protected]>
Co-authored-by: Claude <[email protected]>
6a5b4e6 to
647d008
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.
The
hide()function was lazily traversing hidden commits interleaved with interesting commits during iteration, rather than using proper graph painting. This could potentially include commits that should be hidden if the interesting traversal reached shared ancestors before the hidden traversal painted them.Changes
gix-traverse/src/commit/simple.rs: Refactoredhide()to fully traverse all hidden tips and mark all reachable commits as Hidden before returning. This matches git'srev-list --notbehavior.New tests: Added
hide_with_graph_paintingmodule with tests for:git rev-list --notGraph Painting Approach
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.