Make fast blob reads optional - #9
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes the fast in-process blob reader optional by moving the go-git implementation into a nested github.com/git-pkgs/clone/gogit module, while keeping the root clone module’s blob reads implemented via git show to reduce the dependency graph for clone-only consumers.
Changes:
- Refactors root
clone.Blob/clone.InspectBlobto read blobs via thegitbinary (removing go-git dependencies from the root module graph). - Adds a nested
gogitmodule containing the go-git-backed blob reader, with tests/benchmarks and compatibility fallback togit show. - Updates documentation and CI/Dependabot to account for the additional module.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents root blob behavior (git show) and the opt-in gogit module usage. |
| doc.go | Updates package docs to reference the optional gogit module for in-process blob reads. |
| go.mod | Removes go-git dependencies from the root module. |
| go.sum | Drops go-git-related sums from the root module. |
| blob.go | Switches root blob reads to git show only. |
| blob_test.go | Updates tests to reflect git being required on PATH for root blob reads; moves go-git coverage out. |
| gogit/doc.go | Adds package docs for the gogit module. |
| gogit/blob.go | Implements go-git-backed Blob/InspectBlob with fallback to root clone git-based behavior. |
| gogit/blob_test.go | Adds tests/benchmarks for the gogit blob reader across repo layouts and fallbacks. |
| gogit/object_store.go | Moves/renames the go-git object-store implementation into package gogit. |
| gogit/test_helpers_test.go | Adds git test helpers and deterministic git environment for gogit tests. |
| gogit/go.mod | Introduces the nested module definition and dependencies (including clone). |
| gogit/go.sum | Adds sums for the nested module’s dependency set (go-git graph). |
| .github/workflows/ci.yml | Builds/tests/lints both the root module and the gogit submodule in CI. |
| .github/dependabot.yml | Adds Dependabot updates for gomod in /gogit. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Moves the in-process go-git blob reader into the nested
github.com/git-pkgs/clone/gogitmodule. The rootBlobandInspectBlobfunctions usegit show, so clone-only consumers no longer inherit the go-git module graph. Scrutineer can opt intogogitand keep the fast reader. Includes tests, CI coverage, Dependabot configuration, and usage documentation for both modules.Closes #7.