[PATCH 0/6] odb: add write operation to ODB transaction interface
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Mar 31, 2026, 03:38 UTC
- Message-ID
- <20260331033835.2863514-1-jltobler@gmail.com>
Greetings,
This series lays the groundwork for introducing write operations to the ODB transaction interface. The eventual goal is for all object writes performed within a transaction to go through this interface explicitly, rather than implicitly relying on the transaction to reconfigure ODB sources so that writes are redirected to a temporary location.
For now, only `odb_transaction_write_object_stream()` is implemented and wires up the existing logic for streaming "large" blobs directly into a packfile as part of the transaction.
Most of the patches are structural refactorings to enable this, but patch 4 introduces a behavioral change in how packfiles that would exceed "pack.packSizeLimit" are handled.
Thanks, -Justin
Justin Tobler (6): odb: split `struct odb_transaction` into separate header odb/transaction: use pluggable `begin_transaction()` object-file: remove flags from transaction packfile writes object-file: avoid fd seekback by checking object size upfront object-file: generalize packfile writes to use odb_write_stream odb/transaction: make `write_object_stream()` pluggable
Makefile | 1 + builtin/add.c | 1 + builtin/unpack-objects.c | 1 + builtin/update-index.c | 1 + cache-tree.c | 1 + meson.build | 1 + object-file.c | 249 +++++++++++++++++++++------------------ odb.c | 25 ---- odb.h | 31 ----- odb/transaction.c | 35 ++++++ odb/transaction.h | 57 +++++++++ read-cache.c | 1 + 12 files changed, 234 insertions(+), 170 deletions(-) create mode 100644 odb/transaction.c create mode 100644 odb/transaction.h
base-commit: 5361983c075154725be47b65cca9a2421789e410
-- 2.53.0.381.g628a66ccf6