GeezerVison is showing github.com — Object walk painting by stiak · Pull Request #1973 · go-git/go-git
Conversation
stiak
commented
Apr 9, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
After some of the changes to #1947, the performance gains weren't realised.
This PR restores the performance gains while still maintaining correctness (mainly the commit time ordering issue).
TestRevListObjects_SkewedCommitTimesDoNotResendCommonBase Maintained. The painting commits approach deals with out of order commit times.
Two other tests were changed to match git rev-list behaviour:
TestRevListObjects_ReintroducedBlobInHaveAncestorIsExcluded became TestRevListObjects_ReintroducedBlobInHaveAncestor and verified behaviour against a call to git rev-list.
TestRevListObjects_MissingHaveAncestorReturnsError became TestRevListObjects_MissingHaveAncestorIsTolerated, verified with a call to git rev-list.
Performance summary (Objects is this PR):
┌───────────┬───────────────┬───────────────┬───────────────┐
│ Case │ ObjectsOld │ Objects │ ObjectsTopo │
├───────────┼───────────────┼───────────────┼───────────────┤
│ Full walk │ 553ms / 169MB │ 381ms / 136MB │ 561ms / 198MB │
├───────────┼───────────────┼───────────────┼───────────────┤
│ Diff walk │ 390ms / 145MB │ 75ms / 30MB │ 51ms / 18MB │
└───────────┴───────────────┴───────────────┴───────────────┘
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the revlist.Objects() traversal to restore previously achieved performance improvements while maintaining correctness in the presence of out-of-order commit times, and aligns a couple of edge-case tests with git rev-list --objects behavior.
Changes:
- Reworks the object walk commit traversal to use a “painted” (want/have flags) priority-queue style walk with early stopping.
- Updates/renames regression tests to compare object sets directly against
git rev-list --objects for specific edge cases.
- Refactors some test helpers for building commits/trees across different storers (in-memory vs on-disk fixtures).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File |
Description |
| plumbing/revlist/object_walk.go |
Replaces the interleaved want/have walk with a painted, time-prioritized traversal and adds helpers for sorted insertion / stale detection. |
| plumbing/revlist/revlist_test.go |
Updates regression tests (including comparisons to git rev-list --objects) and refactors commit/tree construction helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
|
{Name: "have", Mode: filemode.Regular, Hash: s.makeBlob("have")},
|
|
|
// gitRevListObjects runs git rev-list --objects want ^have against the
|
|
|
// given git directory and returns the set of object hashes.
|
|
|
func gitRevListObjects(t *testing.T, gitDir string, want, have plumbing.Hash) map[plumbing.Hash]bool {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is brilliant, for this package we are probably better off:
- Making a single table driven test with all current scenarios
- Match execution failure with expected errors from Objects()
- Match the actual objects
This way we have a few different repos with a given set of scenarios, and we can match implementation conformance more easily.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we tackle that in this PR or a separate one?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a separate one is fine. 👍
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Also updates and expands tests to capture more git rev-list behaviour
Assisted-by: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stiak thanks for working on this. 🙇
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 29, 2026
Reviewers
pjbgf
pjbgf approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|