Skip to content

feat(tracked): stream file blobs through the git conversion routes - #18

Merged
lstocchi merged 1 commit into
redhat-developer:mainfrom
lstocchi:stream_blob
Nov 26, 2026
Merged

lstocchi merged 1 commit into
redhat-developer:mainfrom
lstocchi:stream_blob

Conversation

@lstocchi

@lstocchi lstocchi commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Move one regular file from the image into a git blob without holding a
whole file 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. 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_route pipes a file through git hash-object for the
    filter/ident/working-tree-encoding routes and distinguishes an image
    read failure from a clean-filter failure.
  • Filter failures are grouped per driver, so a missing git-lfs is one
    line instead of one per path.
  • A typed BudgetExceeded is terminal; per-path failures refund only
    charges whose bytes never reached git or fast-import.
  • CatFileBatch gains chunked blob_stats and marks itself broken
    after a read error instead of parsing a leftover body as a header.
  • The eol heuristic matches git's gather_stats, including its
    trailing-^Z exception.
  • Ext4Inode::file_size is the single size computation.

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>
@lstocchi
lstocchi merged commit b73a62c into redhat-developer:main Nov 26, 2026
4 checks passed
@lstocchi
lstocchi deleted the stream_blob branch November 26, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant