git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 6/6] object-file: stop including "git-zlib.h"

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 2, 2026, 11:20 UTC
Message-ID
<20261102-pks-odb-loose-cleanups-v1-6-fbbc86c29693@pks.im>
In-Reply-To
<20261102-pks-odb-loose-cleanups-v1-0-fbbc86c29693@pks.im>

We no longer reference `git_zstream` in "object-file.h", but still include its header. Drop the header and add it to all the other users that implicitly depend on it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 apply.c                | 1 +
 builtin/fast-import.c  | 1 +
 builtin/index-pack.c   | 1 +
 builtin/pack-objects.c | 1 +
 diff.c                 | 1 +
 object-file.c          | 1 +
 object-file.h          | 1 -
 odb/source-loose.c     | 1 +
 pack-check.c           | 1 +
 packfile.c             | 1 +
 10 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/apply.c b/apply.c
index a0b7119c639..c705ce06adb 100644
--- a/apply.c
+++ b/apply.c
@@ -21,6 +21,7 @@
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
+#include "git-zlib.h"
 #include "hex.h"
 #include "xdiff-interface.h"
 #include "merge-ll.h"
diff --git a/builtin/fast-import.c b/builtin/fast-import.c
index 9db3f83eea8..c4d955b61f1 100644
--- a/builtin/fast-import.c
+++ b/builtin/fast-import.c
@@ -5,6 +5,7 @@
 #include "abspath.h"
 #include "environment.h"
 #include "gettext.h"
+#include "git-zlib.h"
 #include "hex.h"
 #include "config.h"
 #include "lockfile.h"
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 0264c18c5f8..6d758a04419 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -6,6 +6,7 @@
 #include "delta.h"
 #include "environment.h"
 #include "gettext.h"
+#include "git-zlib.h"
 #include "hex.h"
 #include "pack.h"
 #include "csum-file.h"
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index e53c69af31f..f13c49090a1 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -4,6 +4,7 @@
 #include "builtin.h"
 #include "environment.h"
 #include "gettext.h"
+#include "git-zlib.h"
 #include "hex.h"
 #include "config.h"
 #include "attr.h"
diff --git a/diff.c b/diff.c
index b4ac17f8efc..0309f91f5ab 100644
--- a/diff.c
+++ b/diff.c
@@ -18,6 +18,7 @@
 #include "diff.h"
 #include "diffcore.h"
 #include "delta.h"
+#include "git-zlib.h"
 #include "hex.h"
 #include "xdiff-interface.h"
 #include "color.h"
diff --git a/object-file.c b/object-file.c
index 917a65d5b33..cf859520949 100644
--- a/object-file.c
+++ b/object-file.c
@@ -15,6 +15,7 @@
 #include "environment.h"
 #include "fsck.h"
 #include "gettext.h"
+#include "git-zlib.h"
 #include "hex.h"
 #include "loose.h"
 #include "object-file-convert.h"
diff --git a/object-file.h b/object-file.h
index 746356ceb51..70138a358de 100644
--- a/object-file.h
+++ b/object-file.h
@@ -1,7 +1,6 @@
 #ifndef OBJECT_FILE_H
 #define OBJECT_FILE_H
 
-#include "git-zlib.h"
 #include "object.h"
 #include "odb.h"
 #include "odb/streaming.h"
diff --git a/odb/source-loose.c b/odb/source-loose.c
index 5cd679e802c..737d583f033 100644
--- a/odb/source-loose.c
+++ b/odb/source-loose.c
@@ -3,6 +3,7 @@
 #include "chdir-notify.h"
 #include "dir.h"
 #include "gettext.h"
+#include "git-zlib.h"
 #include "hex.h"
 #include "loose.h"
 #include "object-file.h"
diff --git a/pack-check.c b/pack-check.c
index 605811b7b09..c6c3d7c9c0c 100644
--- a/pack-check.c
+++ b/pack-check.c
@@ -2,6 +2,7 @@
 
 #include "git-compat-util.h"
 #include "environment.h"
+#include "git-zlib.h"
 #include "hex.h"
 #include "repository.h"
 #include "pack.h"
diff --git a/packfile.c b/packfile.c
index b32b4cd75da..59e0e0c1c91 100644
--- a/packfile.c
+++ b/packfile.c
@@ -3,6 +3,7 @@
 #include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
+#include "git-zlib.h"
 #include "hex.h"
 #include "list.h"
 #include "pack.h"
-- 
2.56.0.500.g5d06dc02cd.dirty
Previous: Patrick Steinhardt
Message 7 of 7 in “object-file: move logic related to the loose backend”
  1. 0/6 object-file: move logic related to the loose backendPatrick Steinhardt, Nov 2, 2026
  2. 1/6 object-file: move logic to read loose objects into backendPatrick Steinhardt, Nov 2, 2026
  3. 2/6 object-file: move logic to derive loose object paths into backendPatrick Steinhardt, Nov 2, 2026
  4. 3/6 object-file: move iteration over loose files into backendPatrick Steinhardt, Nov 2, 2026
  5. 4/6 odb/source-loose: deduplicate logic to mmap objectsPatrick Steinhardt, Nov 2, 2026
  6. 5/6 object-file: stop including "odb/source-loose.h"Patrick Steinhardt, Nov 2, 2026
  7. 6/6 object-file: stop including "git-zlib.h"Patrick Steinhardt, Nov 2, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.