git/odb
Justin Tobler 2154d88f3a odb/transaction: add transaction interface to write packfiles
In git-receive-pack(1), the incoming packfile is written to the ODB via
`unpack()`, which spawns git-index-pack(1) or git-unpack-objects(1)
directly. With pluggable object databases, an alternative backend may
need to handle writing packfile data differently though.

Introduce `odb_transaction_write_pack()` as a generic interface to
handle writing a packfile to a transaction and use the logic from
`unpack()` as the "files" backend implementation. Note that when storing
the objects as a packfile, git-index-pack(1) also writes a ".keep"
lockfile next to it to prevent a concurrent repack from removing the new
pack prior to reference updates being performed. The "files" transaction
backend is responsible for managing these ".keep" files and removes them
post-commit once the transaction is finalized.

Call sites in git-receive-pack(1) are updated accordingly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-20 20:28:02 -07:00
..
source-files.c Merge branch 'ps/odb-pluggable-housekeeping' 2026-08-05 11:10:51 -07:00
source-files.h odb: make optimizations pluggable 2026-07-13 08:13:17 -07:00
source-inmemory.c Merge branch 'jt/receive-pack-use-odb-transactions' 2026-07-22 10:30:53 -07:00
source-inmemory.h
source-loose.c Merge branch 'jt/receive-pack-use-odb-transactions' 2026-07-22 10:30:53 -07:00
source-loose.h odb/source-loose: drop pointer to the "files" source 2026-06-01 18:47:19 +09:00
source-packed.c Merge branch 'ps/odb-move-loose-object-writing' 2026-07-30 10:32:05 -07:00
source-packed.h Merge branch 'ps/odb-generalize-prepare' 2026-07-13 08:27:28 -07:00
source.c
source.h Merge branch 'ps/odb-pluggable-housekeeping' 2026-08-05 11:10:51 -07:00
streaming.c odb: use size_t for object_info.sizep and the size APIs 2026-06-15 07:45:41 -07:00
streaming.h Merge branch 'ps/odb-in-memory' into ps/odb-source-loose 2026-05-21 22:34:55 +09:00
transaction.c odb/transaction: add transaction interface to write packfiles 2026-08-20 20:28:02 -07:00
transaction.h odb/transaction: add transaction interface to write packfiles 2026-08-20 20:28:02 -07:00