Skip to content

git: Add streaming batch object reads - #1480

Merged
abhinav merged 1 commit into
mainfrom
git-object-batch-reader
Oct 25, 2026
Merged

abhinav merged 1 commit into
mainfrom
git-object-batch-reader

Conversation

@abhinav

@abhinav abhinav commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Reading several objects separately starts one cat-file process per
object.
ReadObjects reads all requested hashes through one cat-file --batch
process instead.

Expose a tar.Reader-style ObjectBatchReader: Next returns object
metadata and skips any unread body, Read stops at that object's EOF,
and Close waits for completion or terminates an unfinished batch.
Object bodies are size-framed, so embedded newlines and NUL bytes
remain unchanged.
Use LF-delimited headers for compatibility with Git 2.38.

@abhinav

abhinav commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner Author

@abhinav
abhinav added this pull request to stack #1482 October 24, 2026 20:54
@abhinav abhinav added the skip changelog PRs that don't need a changelog. label Oct 24, 2026
Reading several objects separately starts one cat-file process per
object.
ReadObjects reads all requested hashes through one cat-file --batch
process instead.

Expose a tar.Reader-style ObjectBatchReader: Next returns object
metadata and skips any unread body, Read stops at that object's EOF,
and Close waits for completion or terminates an unfinished batch.
Object bodies are size-framed, so embedded newlines and NUL bytes
remain unchanged.
Use LF-delimited headers for compatibility with Git 2.38.
@abhinav
abhinav force-pushed the git-object-batch-reader branch from 6c2e84a to 647b25c Compare October 25, 2026 18:26
@abhinav
abhinav merged commit 983e647 into main Oct 25, 2026
22 checks passed
@abhinav
abhinav deleted the git-object-batch-reader branch October 25, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog PRs that don't need a changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant