All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] object-file: move writing of loose objects into "loose" source
@ 2026-07-17  9:32 Patrick Steinhardt
  2026-07-17  9:32 ` [PATCH 1/9] odb: compute compat object ID in `odb_write_object_ext()` Patrick Steinhardt
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Patrick Steinhardt @ 2026-07-17  9:32 UTC (permalink / raw)
  To: git; +Cc: Justin Tobler

Hi,

this patch series refactors "object-file.c" so that we can move the
logic that writes loose objects into "odb/source-loose.c". This ensures
that the logic to read and write loose objects is mostly self-contained
within that source's implementation now.

To achieve that, this series first refactors `force_object_loose()` so
that it can work on top of the generic `odb_source_write_object()`
instead of having to call into `write_loose_object()`. This is the bulk
of the patch series.

This patch series is built on top of 44de1520f0 (Merge branch 'master'
of https://github.com/j6t/git-gui, 2026-07-16) with the following two
topics merged into it:

  - jt/receive-pack-use-odb-transaction at bdee7b3013
    (builtin/receive-pack: stage incoming objects via ODB transactions,
    2026-07-10).

  - jk/git-hash-cleanups at 9e396aa553 (hash: check ctx->active flag in
    all wrapper functions, 2026-07-07).

Note that jt/receive-pack-use-odb-transaction requires an evil merge:

diff --git a/odb/source-packed.c b/odb/source-packed.c
index 06b31dd743..cbb06da038 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");
 }

Thanks!

Patrick

---
Patrick Steinhardt (9):
      odb: compute compat object ID in `odb_write_object_ext()`
      t/u-odb-inmemory: implement wrapper for writing objects
      odb: compute object hash in `odb_write_object_ext()`
      odb: lift object existence check out of the "loose" backend
      odb: support setting mtime when writing objects
      object-file: fix memory leak in `force_object_loose()`
      object-file: force objects loose via generic interface
      object-file: move `force_object_loose()`
      object-file: move logic to write loose objects

 builtin/pack-objects.c        |  48 ++++-
 object-file.c                 | 449 +++---------------------------------------
 object-file.h                 |  32 +--
 odb.c                         |  39 +++-
 odb.h                         |  10 +-
 odb/source-files.c            |  14 +-
 odb/source-inmemory.c         |  14 +-
 odb/source-loose.c            | 402 +++++++++++++++++++++++++++++++++----
 odb/source-packed.c           |  17 +-
 odb/source.h                  |  20 +-
 read-cache.c                  |   2 +-
 t/unit-tests/u-odb-inmemory.c |  53 +++--
 12 files changed, 551 insertions(+), 549 deletions(-)


---
base-commit: 8061f1ea286318fbf976f58df3985bd60237b8a7
change-id: 20260703-pks-odb-move-loose-object-writing-8bcf1f51b04d


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-07-19  5:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17  9:32 [PATCH 0/9] object-file: move writing of loose objects into "loose" source Patrick Steinhardt
2026-07-17  9:32 ` [PATCH 1/9] odb: compute compat object ID in `odb_write_object_ext()` Patrick Steinhardt
2026-07-17  9:32 ` [PATCH 2/9] t/u-odb-inmemory: implement wrapper for writing objects Patrick Steinhardt
2026-07-17  9:32 ` [PATCH 3/9] odb: compute object hash in `odb_write_object_ext()` Patrick Steinhardt
2026-07-17  9:32 ` [PATCH 4/9] odb: lift object existence check out of the "loose" backend Patrick Steinhardt
2026-07-17  9:32 ` [PATCH 5/9] odb: support setting mtime when writing objects Patrick Steinhardt
2026-07-17  9:32 ` [PATCH 6/9] object-file: fix memory leak in `force_object_loose()` Patrick Steinhardt
2026-07-17  9:32 ` [PATCH 7/9] object-file: force objects loose via generic interface Patrick Steinhardt
2026-07-17  9:32 ` [PATCH 8/9] object-file: move `force_object_loose()` Patrick Steinhardt
2026-07-17  9:32 ` [PATCH 9/9] object-file: move logic to write loose objects Patrick Steinhardt
2026-07-18 19:39 ` [PATCH 0/9] object-file: move writing of loose objects into "loose" source SZEDER Gábor
2026-07-19  1:04   ` Junio C Hamano
2026-07-19  5:48     ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.