Git development
 help / color / mirror / Atom feed
* [PATCH 00/18] odb: make loose object source a proper `struct odb_source`
@ 2026-05-21  8:22 Patrick Steinhardt
  2026-05-21  8:22 ` [PATCH 01/18] odb/source-loose: move loose source into "odb/" subsystem Patrick Steinhardt
                   ` (17 more replies)
  0 siblings, 18 replies; 22+ messages in thread
From: Patrick Steinhardt @ 2026-05-21  8:22 UTC (permalink / raw)
  To: git

Hi,

this patch series converts the loose object source into a proper `struct
odb_source` so that it can be used via our generic interfaces.

The patch series is relatively straight-forward, as the source basically
already exists as such and the interfaces already match. So for most of
the part we are just moving around some code and converting functions
that were previously called directly into callbacks.

I guess the only part that needs some attention is that there is some
confusion at first with the `struct odb_source_loose::source` parent
pointer that initially points at the owning `struct odb_source_files`.
This relationship doesn't make much sense, as a loose source can totally
exist standalone without the files source.

We're thus getting rid of this relationship in this series, too. I found
it quite hard to reason about which pointer one is holding at any point
in time though, doubly so because the parent pointer was named "source",
which is rather generic. The second commit thus renames the pointer to
`files` and converts it into `struct odb_source_files` to make the
transition cleaner, but the whole pointer will be dropped at the end of
this series.

The series is built on top of aec3f58750 (Sync with 'maint', 2026-05-21)
with ps/odb-in-memory at d2902a4549 (t/unit-tests: add tests for the
in-memory object source, 2026-04-10) merged into it.

Thanks!

Patrick

---
Patrick Steinhardt (18):
      odb/source-loose: move loose source into "odb/" subsystem
      odb/source-loose: store pointer to "files" instead of generic source
      odb/source-loose: start converting to a proper `struct odb_source`
      odb/source-loose: wire up `reprepare()` callback
      odb/source-loose: wire up `close()` callback
      odb/source-loose: wire up `read_object_info()` callback
      odb/source-loose: wire up `read_object_stream()` callback
      odb/source-loose: wire up `for_each_object()` callback
      odb/source-loose: wire up `find_abbrev_len()` callback
      odb/source-loose: wire up `count_objects()` callback
      odb/source-loose: drop `odb_source_loose_has_object()`
      odb/source-loose: wire up `freshen_object()` callback
      loose: refactor object map to operate on `struct odb_source_loose`
      odb/source-loose: wire up `write_object()` callback
      object-file: refactor writing objects to use loose source
      odb/source-loose: wire up `write_object_stream()` callback
      odb/source-loose: stub out remaining callbacks
      odb/source-loose: drop pointer to the "files" source

 Makefile               |   1 +
 builtin/cat-file.c     |   5 +-
 builtin/gc.c           |   6 +-
 builtin/pack-objects.c |  12 +-
 http-walker.c          |   3 +-
 http.c                 |   6 +-
 loose.c                |  45 ++-
 loose.h                |   4 +-
 meson.build            |   1 +
 object-file.c          | 796 ++++---------------------------------------------
 object-file.h          | 149 ++++-----
 odb/source-files.c     |  28 +-
 odb/source-loose.c     | 736 +++++++++++++++++++++++++++++++++++++++++++++
 odb/source-loose.h     |  48 +++
 odb/source.h           |   3 +
 15 files changed, 973 insertions(+), 870 deletions(-)


---
base-commit: 072edab49f312c80561b2899f03f361f74fc38e4
change-id: 20260413-b4-pks-odb-source-loose-4900c8ca91db


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

end of thread, other threads:[~2026-05-22  6:12 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-21  8:22 [PATCH 00/18] odb: make loose object source a proper `struct odb_source` Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 01/18] odb/source-loose: move loose source into "odb/" subsystem Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 02/18] odb/source-loose: store pointer to "files" instead of generic source Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 03/18] odb/source-loose: start converting to a proper `struct odb_source` Patrick Steinhardt
2026-05-21 15:49   ` Junio C Hamano
2026-05-21  8:22 ` [PATCH 04/18] odb/source-loose: wire up `reprepare()` callback Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 05/18] odb/source-loose: wire up `close()` callback Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 06/18] odb/source-loose: wire up `read_object_info()` callback Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 07/18] odb/source-loose: wire up `read_object_stream()` callback Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 08/18] odb/source-loose: wire up `for_each_object()` callback Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 09/18] odb/source-loose: wire up `find_abbrev_len()` callback Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 10/18] odb/source-loose: wire up `count_objects()` callback Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 11/18] odb/source-loose: drop `odb_source_loose_has_object()` Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 12/18] odb/source-loose: wire up `freshen_object()` callback Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 13/18] loose: refactor object map to operate on `struct odb_source_loose` Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 14/18] odb/source-loose: wire up `write_object()` callback Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 15/18] object-file: refactor writing objects to use loose source Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 16/18] odb/source-loose: wire up `write_object_stream()` callback Patrick Steinhardt
2026-05-21 17:49   ` Junio C Hamano
2026-05-22  6:12     ` Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 17/18] odb/source-loose: stub out remaining callbacks Patrick Steinhardt
2026-05-21  8:22 ` [PATCH 18/18] odb/source-loose: drop pointer to the "files" source Patrick Steinhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox