Repository navigation
feat(tracked): stream file blobs through the git conversion routes - #18
Merged
Merged
Conversation
This commit contains the routines that move one regular file from the image into a blob without holding it in memory. - `stream_file` emits raw blobs through `ExactLen` straight into fast-import, and converting blobs through a bounded `Spool` (8 MiB in memory, a temp file above it) so `data <n>` gets the exact normalized length up front. The auto eol rule consults the parent tree's reference blob, as git's new-file case does. - `hash_object_route` pipes a file through `git hash-object` for the filter/ident/working-tree-encoding routes. - Filter failures are grouped per driver, so a missing `git-lfs` is one line instead of one per starting Assisted-by: Claude Code: GLM 5.3 Assisted-by: Claude Code: Opus 5.5 Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
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.
Move one regular file from the image into a git blob without holding a
whole file in memory.
stream_fileemits raw blobs throughExactLenstraight intofast-import, and converting blobs through a bounded
Spool(8 MiB inmemory, a temp file above it) so
data <n>gets the exact normalizedlength up front. Frame and budget come from the inode read at stream
time; the auto eol rule consults the parent tree's reference blob via
streamed statistics.
hash_object_routepipes a file throughgit hash-objectfor thefilter/ident/working-tree-encoding routes and distinguishes an image
read failure from a clean-filter failure.
git-lfsis oneline instead of one per path.
BudgetExceededis terminal; per-path failures refund onlycharges whose bytes never reached git or fast-import.
CatFileBatchgains chunkedblob_statsand marks itself brokenafter a read error instead of parsing a leftover body as a header.
gather_stats, including itstrailing-^Z exception.
Ext4Inode::file_sizeis the single size computation.