UPSTREAM PR #2526: gix,gix-odb,gix-pack: stream blob contents from the ODB#45
Open
loci-dev wants to merge 6 commits into
Open
UPSTREAM PR #2526: gix,gix-odb,gix-pack: stream blob contents from the ODB#45loci-dev wants to merge 6 commits into
loci-dev wants to merge 6 commits into
Conversation
Add streaming blob lookup support for loose and packed objects, avoid eagerly materializing packed results into memory, and expose repository helpers with regression coverage for loose, packed, empty, and wrong-type cases. Co-authored-by: Claude Co-authored-by: Codex
Reject truncated loose-object streams, restore delta output-length validation, and add allocator-backed proof that packed delta blob streaming lowers peak memory usage compared to eager blob lookup. Co-authored-by: Codex
Bring the gix_object::Write trait into scope for write_buf() and remove the unused Read import so workspace clippy and test builds pass again. Co-authored-by: Codex
Accept both UnexpectedEof and InvalidData for truncated loose-object stream corruption, as the stream reader can surface either depending on where zlib detects the truncated deflate payload. Co-authored-by: Codex
e902b63 to
c6739bc
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.
Note
Source pull request: GitoxideLabs/gitoxide#2526
Add streaming blob lookup support for loose and packed objects, avoid eagerly materializing packed results into memory, and expose repository helpers with regression coverage for loose, packed, empty, and wrong-type cases.
Addresses #1595.
Summary
This adds blob-only streaming reads from the object database so callers can obtain blob contents without first materializing the full object in memory.
At the repository level, this introduces blob streaming helpers that:
Implementation
To support this, the change adds a streaming object path through the ODB stack.
Loose objects are exposed as a reader over incremental decompression.
Packed objects are decoded into a temporary file and then returned as a readable stream. This avoids holding the fully resolved blob in RAM, including for delta-resolved packed blobs, while still fitting the existing pack decoding model.
The repository-facing API is intentionally blob-only for now, which keeps the surface area aligned with the use case described in this issue.
Tests
Added coverage for:
Also validated with:
cargo test -p gixcargo test -p gix-odbcargo test -p gix-packNotes
Co-authored-by: Claude
Co-authored-by: Codex