calculate new commit oids on each push - #121
Closed
brad-swenson wants to merge 1 commit into
Closed
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for computing commit OIDs that are newly introduced by a push (present in the quarantine object directory but not in the main repo) and persisting them as a file in the quarantine directory, along with test coverage and a fixture repo to exercise the behavior.
Changes:
- Invoke
writeNewCommitOIDs()after a successful pack ingest to writeobjects/<quarantine_id>/new_objects_<quarantine_id>. - Implement
writeNewCommitOIDs()usinggit cat-filepipelines to find commit objects missing from the main repo. - Add a unit test plus a bare-repo fixture (
testdata/quarantine-new-commit.git) containing both main and quarantined pack data.
Reviewed changes
Copilot reviewed 9 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/spokes/spokes.go | Calls new OID writer during push execution and adds writeNewCommitOIDs() implementation. |
| internal/spokes/spokes_test.go | Adds TestWriteNewCommitOIDs validating the generated new_objects_<id> file. |
| internal/spokes/testdata/quarantine-new-commit.git/HEAD | Fixture repo HEAD reference. |
| internal/spokes/testdata/quarantine-new-commit.git/config | Fixture repo config for bare repository. |
| internal/spokes/testdata/quarantine-new-commit.git/description | Fixture repo description file. |
| internal/spokes/testdata/quarantine-new-commit.git/info/exclude | Fixture repo default exclude file. |
| internal/spokes/testdata/quarantine-new-commit.git/info/refs | Fixture repo advertised refs for the main branch. |
| internal/spokes/testdata/quarantine-new-commit.git/objects/info/commit-graph | Fixture commit-graph supporting object enumeration. |
| internal/spokes/testdata/quarantine-new-commit.git/objects/info/packs | Fixture pack listing for main repo objects. |
| internal/spokes/testdata/quarantine-new-commit.git/objects/pack/pack-26638a754743afcd6af4c06077541c5c8cbf8610.bitmap | Fixture bitmap for main repo pack. |
| internal/spokes/testdata/quarantine-new-commit.git/objects/pack/pack-26638a754743afcd6af4c06077541c5c8cbf8610.idx | Fixture index for main repo pack. |
| internal/spokes/testdata/quarantine-new-commit.git/objects/pack/pack-26638a754743afcd6af4c06077541c5c8cbf8610.pack | Fixture pack containing main repo objects. |
| internal/spokes/testdata/quarantine-new-commit.git/objects/pack/pack-26638a754743afcd6af4c06077541c5c8cbf8610.rev | Fixture reverse index for main repo pack. |
| internal/spokes/testdata/quarantine-new-commit.git/objects/1/pack/pack-d0b1efac99b5d57732198f0c3b7d62dd598e91f5.idx | Fixture index for quarantined pack objects. |
| internal/spokes/testdata/quarantine-new-commit.git/objects/1/pack/pack-d0b1efac99b5d57732198f0c3b7d62dd598e91f5.pack | Fixture quarantined pack containing the “new” commit object(s). |
| internal/spokes/testdata/quarantine-new-commit.git/objects/1/pack/pack-d0b1efac99b5d57732198f0c3b7d62dd598e91f5.rev | Fixture reverse index for quarantined pack. |
| internal/spokes/testdata/quarantine-new-commit.git/packed-refs | Fixture packed refs for main branch. |
Comments suppressed due to low confidence (1)
internal/spokes/spokes_test.go:301
- The test removes
new_objects_1without checking the returned error, and cleanup only happens at the end of the test body. Consider usingt.Cleanup(and checking errors) so the file is removed even if an assertion fails earlier, preventing testdata pollution between runs.
os.Remove(filepath.Join(wd, "objects", "1", "new_objects_1"))
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
brad-swenson
force-pushed
the
brad-swenson/new-oids-on-push
branch
from
February 10, 2026 19:58
787dd67 to
e7f3eb5
Compare
migue
reviewed
Feb 11, 2026
migue
left a comment
Contributor
There was a problem hiding this comment.
The changes look reasonable to me
brad-swenson
force-pushed
the
brad-swenson/new-oids-on-push
branch
from
February 11, 2026 15:22
e7f3eb5 to
5826df9
Compare
Compare all the commit oids in the quarantine packfiles to the existing repository and save all the new commit oids into objects/<quarantine_id>/new_objects_<quarantine_id>.
brad-swenson
force-pushed
the
brad-swenson/new-oids-on-push
branch
from
February 11, 2026 15:40
5826df9 to
e186d41
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.
Compare all the commit oids in the quarantine packfiles to the existing repository and save all the new commit oids into
objects/<quarantine_id>/new_objects_<quarantine_id>.