GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Object walk painting by stiak · Pull Request #1973 · go-git/go-git

Conversation

@stiak

@stiak stiak commented Apr 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions
Copilot AI review requested due to automatic review settings April 9, 2026 01:04
Copilot started reviewing on behalf of stiak April 9, 2026 01:04
View session
Copilot AI reviewed Apr 9, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

All reactions
Comment thread plumbing/revlist/revlist_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread plumbing/revlist/revlist_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread plumbing/revlist/object_walk.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread plumbing/revlist/object_walk.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread plumbing/revlist/object_walk.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread plumbing/revlist/object_walk.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@stiak
stiak force-pushed the object-walk-painting branch 3 times, most recently from 5601c61 to 83d1695 Compare April 9, 2026 01:27
pjbgf
pjbgf reviewed Apr 10, 2026
View reviewed changes
Comment thread plumbing/revlist/revlist_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

pjbgf
pjbgf reviewed Apr 10, 2026
View reviewed changes
Comment thread plumbing/revlist/object_walk.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

pjbgf
pjbgf reviewed Apr 11, 2026
View reviewed changes
Comment thread plumbing/revlist/revlist_test.go
{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 {

@pjbgf pjbgf Apr 11, 2026

Copy link
Copy Markdown
Member

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.

All reactions

@stiak stiak Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

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.

All reactions

@pjbgf pjbgf Apr 14, 2026

Copy link
Copy Markdown
Member

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.

All reactions
@stiak
stiak force-pushed the object-walk-painting branch from d4d01e6 to 10d5287 Compare April 13, 2026 23:51
@stiak
plumbing: revlist: Use painting algorithm for faster ancestor detection
fe32f7a
Also updates and expands tests to capture more git rev-list behaviour

Assisted-by: Claude Opus 4.6 (1M context) <[email protected]>
@stiak
stiak force-pushed the object-walk-painting branch from 10d5287 to fe32f7a Compare April 13, 2026 23:52
pjbgf
pjbgf approved these changes Apr 14, 2026
View reviewed changes

@pjbgf pjbgf left a comment

Copy link
Copy Markdown
Member

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.

All reactions
@pjbgf
pjbgf merged commit cddbbe4 into go-git:main Apr 14, 2026
16 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@stiak
stiak deleted the object-walk-painting branch April 14, 2026 23:00
This was referenced Aug 29, 2026
plumbing/revlist: ObjectsWithRef walks the object graph once per want, but UploadPack only needs membership #2350
Closed
plumbing: transport, Walk the object graph once per upload-pack request. Refs #2350 #2351
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@pjbgf pjbgf pjbgf approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

3 participants

@stiak @pjbgf
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.