Re: [PATCH 0/6] receive-pack: use ODB transactions to stage object writes
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 24, 2026, 20:09 UTC
- Message-ID
- <xmqqechvitu3.fsf@gitster.g>
- In-Reply-To
- <20260624041920.2601961-1-jltobler@gmail.com>
Justin Tobler <jltobler@gmail.com> writes:
Show 13 quoted lines
> Greetings, > > This patch series replaces direct usage of the `tmp_objdir` interfaces > in git-receive-pack(1) to instead use the `odb_transaction` interfaces > to create/manage a staging area to write objects to. The purpose of this > change is to get git-receive-pack(1) one step closer to being ODB > backend agnostic. For now, the object writes themselves are still > "files" backend specific due to being handled by the git-index-pack(1) > and git-unpack-objects(1) child processes. This will be tackled in a > separate series though. > > Thanks, > -Justin
The integration cycle this morning was somehow more painful than other cycles.
FYI, this topic had some interactions with ps/odb-source-packed and ps/refs-avoid-chdir-notify-reparent and needed the following evil-merge fix to make it build.
commit 721c15c1d5ef8f8aab8b9f50463e979e890b1ab6 Author: Junio C Hamano <gitster@pobox.com> Date: Wed Jun 24 12:45:35 2026 -0700
merge-fix/jt/receive-pack-use-odb-transactions
conflict with ps/odb-source-packed and ps/refs-avoid-chdir-notify-reparentdiff --git a/odb/source-packed.c b/odb/source-packed.c index c3c26fb53e..b9231a8da0 100644 --- a/odb/source-packed.c +++ b/odb/source-packed.c @@ -545,7 +545,8 @@ static int odb_source_packed_write_object_stream(struct odb_source *source UNUSE } static int odb_source_packed_begin_transaction(struct odb_source *source UNUSED, - struct odb_transaction **out UNUSED) + struct odb_transaction **out UNUSED, + enum odb_transaction_flags flags UNUSED) { return error("packed backend cannot begin transactions"); } diff --git a/t/unit-tests/u-reftable-table.c b/t/unit-tests/u-reftable-table.c index a35bbc8004..dd5db06534 100644 --- a/t/unit-tests/u-reftable-table.c +++ b/t/unit-tests/u-reftable-table.c @@ -235,7 +235,8 @@ void test_reftable_table__seek_invalid_log_offset(void) uint8_t *footer; cl_reftable_write_to_buf(&buf, refs, ARRAY_SIZE(refs), - logs, ARRAY_SIZE(logs), NULL); + logs, ARRAY_SIZE(logs), + REFTABLE_HASH_SHA1, NULL); /* * Corrupt the log section offset stored in the footer so that it points @@ -278,7 +279,8 @@ void test_reftable_table__new_with_truncated_table(void) struct reftable_table *table; struct reftable_buf buf = REFTABLE_BUF_INIT; - cl_reftable_write_to_buf(&buf, refs, ARRAY_SIZE(refs), NULL, 0, NULL); + cl_reftable_write_to_buf(&buf, refs, ARRAY_SIZE(refs), NULL, 0, + REFTABLE_HASH_SHA1, NULL); /* * Truncate the table so that it is large enough to read the header, but