Git development
 help / color / mirror / Atom feed
* [PATCH 0/6] object-file: move logic related to the loose backend
@ 2026-11-02 11:20 Patrick Steinhardt
  2026-11-02 11:20 ` [PATCH 1/6] object-file: move logic to read loose objects into backend Patrick Steinhardt
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Patrick Steinhardt @ 2026-11-02 11:20 UTC (permalink / raw)
  To: git

Hi,

this small patch series moves logic that relates to the loose backend
from "object-file.c" into "odb/source-loose.c". On the one hand this
makes the backend more self-contained. On the other hand, this also lets
us quickly identify exactly those code units that still access internal
implementation details of the "loose" backend by grepping for those
files that include "odb/source-loose.h".

The second reason is in fact the main driver. I've got two more patch
series pending that do the same for the "packed" and "files" backends.
With those changes in it becomes trivial to do a quick "reality" check
of which subsystems are fully backend agnostic and which ones still need
more work.

The series is built on top of ebdc087dc99 (The 13th batch, 2026-11-01),
but it conflicts with bc/restrict-hex-to-lowercase. This conflict can be
easily resolved by deleting the conflicting section in "object-file.c" and
adding this diff in "odb/source-loose.c":

diff --git a/odb/source-loose.c b/odb/source-loose.c
index 54f680d6d78..e92da0d8b2e 100644
--- a/odb/source-loose.c
+++ b/odb/source-loose.c
@@ -81,7 +81,7 @@ static int for_each_file_in_obj_subdir(unsigned int subdir_nr,
 		strbuf_add(path, de->d_name, namelen);
 		if (namelen == algop->hexsz - 2 &&
 		    !hex_to_bytes(oid.hash + 1, de->d_name,
-				  algop->rawsz - 1)) {
+				  algop->rawsz - 1, HEX_KIND_OID)) {
 			oid_set_algo(&oid, algop);
 			memset(oid.hash + algop->rawsz, 0,
 			       GIT_MAX_RAWSZ - algop->rawsz);

Thanks!

Patrick

---
Patrick Steinhardt (6):
      object-file: move logic to read loose objects into backend
      object-file: move logic to derive loose object paths into backend
      object-file: move iteration over loose files into backend
      odb/source-loose: deduplicate logic to mmap objects
      object-file: stop including "odb/source-loose.h"
      object-file: stop including "git-zlib.h"

 apply.c                 |   1 +
 builtin/count-objects.c |   1 +
 builtin/fast-import.c   |   1 +
 builtin/gc.c            |   1 +
 builtin/index-pack.c    |   1 +
 builtin/pack-objects.c  |   2 +
 builtin/prune.c         |   1 +
 diff.c                  |   1 +
 http-walker.c           |   1 +
 http.c                  |   1 +
 loose.c                 |   1 +
 object-file.c           | 419 +---------------------------------------------
 object-file.h           | 100 +----------
 odb/source-loose.c      | 429 ++++++++++++++++++++++++++++++++++++++++++++++--
 odb/source-loose.h      |  41 +++++
 pack-check.c            |   1 +
 packfile.c              |   1 +
 prune-packed.c          |   1 +
 setup.c                 |   1 +
 19 files changed, 476 insertions(+), 529 deletions(-)


---
base-commit: ebdc087dc99d68bb340c282b2ba5f722def28d19
change-id: 20261013-pks-odb-loose-cleanups-fb7e5b890389


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

end of thread, other threads:[~2026-11-11 13:40 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02 11:20 [PATCH 0/6] object-file: move logic related to the loose backend Patrick Steinhardt
2026-11-02 11:20 ` [PATCH 1/6] object-file: move logic to read loose objects into backend Patrick Steinhardt
2026-11-10 13:10   ` Kaartic Sivaraam
2026-11-11 13:38     ` Patrick Steinhardt
2026-11-02 11:20 ` [PATCH 2/6] object-file: move logic to derive loose object paths " Patrick Steinhardt
2026-11-10 13:28   ` Kaartic Sivaraam
2026-11-11 13:40     ` Patrick Steinhardt
2026-11-02 11:20 ` [PATCH 3/6] object-file: move iteration over loose files " Patrick Steinhardt
2026-11-10 13:57   ` Kaartic Sivaraam
2026-11-02 11:20 ` [PATCH 4/6] odb/source-loose: deduplicate logic to mmap objects Patrick Steinhardt
2026-11-10 14:15   ` Kaartic Sivaraam
2026-11-11 13:40     ` Patrick Steinhardt
2026-11-02 11:20 ` [PATCH 5/6] object-file: stop including "odb/source-loose.h" Patrick Steinhardt
2026-11-10 16:13   ` Kaartic Sivaraam
2026-11-11 13:40     ` Patrick Steinhardt
2026-11-02 11:20 ` [PATCH 6/6] object-file: stop including "git-zlib.h" Patrick Steinhardt
2026-11-10 16:13   ` Kaartic Sivaraam

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