Thread View: linux.kernel.git
1 messages
1 total messages
Started by Kaartic Sivaraam
Tue, 10 Nov 2026 16:13
Re: [PATCH 5/6] object-file: stop including "odb/source-loose.h"
Author: Kaartic Sivaraam
Date: Tue, 10 Nov 2026 16:13
Date: Tue, 10 Nov 2026 16:13
93 lines
13616 bytes
13616 bytes
On 11/2/26 16:50, Patrick Steinhardt wrote:
> We have now moved all functionality that relate to the loose backend
> from "object-file.c" into the backend itself. Wrap up these refactorings
> by not including "odb/source-loose.h" anymore and instead include the
> file explicitly in all compilation units that require access to it.
>
> Like this we can trivially identify exactly those files that still
> depend on details of the loose backend itself and that thus require
> further work to become truly backend-agnostic.
>
A sensible thing to do.
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> builtin/pack-objects.c | 1 +
> http-walker.c | 1 +
> http.c | 1 +
> loose.c | 1 +
> object-file.c | 1 +
> object-file.h | 2 +-
> setup.c | 1 +
> 7 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
> index ca3a891dfbc..e53c69af31f 100644
> --- a/builtin/pack-objects.c
> +++ b/builtin/pack-objects.c
> @@ -34,6 +34,7 @@
> #include "object-file.h"
I think we can lose "object-file.h" in this one. The code seems to
compile fine without it.
> #include "object-file-convert.h"
> #include "odb.h"
> +#include "odb/source-loose.h"
> #include "odb/streaming.h"
> #include "replace-object.h"
> #include "dir.h"
> diff --git a/http-walker.c b/http-walker.c
> index 4f50dd9b8d0..13730a27847 100644
> --- a/http-walker.c
> +++ b/http-walker.c
> @@ -11,6 +11,7 @@
> #include "packfile.h"
> #include "object-file.h"
> #include "odb.h"
> +#include "odb/source-loose.h"
>
Ah ha. Looks like I was a bit premature. The http-walker.c change I
proposed in 2/6 actually belongs here.
> struct alt_base {
> char *base;
> diff --git a/loose.c b/loose.c
> index d6a2bb5ba3c..64cd6f1c3c1 100644
> --- a/loose.c
> +++ b/loose.c
> @@ -4,6 +4,7 @@
> #include "object-file.h"
Ditto here about losing the object-file.h
> #include "odb.h"
> #include "odb/source-files.h"
> +#include "odb/source-loose.h"
> #include "hex.h"
> #include "repository.h"
> #include "wrapper.h"
> diff --git a/object-file.h b/object-file.h
> index 83d3f38a540..746356ceb51 100644
> --- a/object-file.h
> +++ b/object-file.h
> @@ -4,7 +4,7 @@
> #include "git-zlib.h"
> #include "object.h"
> #include "odb.h"
> -#include "odb/source-loose.h"
> +#include "odb/streaming.h"
Do we really need odb/streaming.h? Code seems to compile and tests are
happy even without it?
> #include "odb/transaction.h"
>
> /* The maximum size for an object header. */
--
Sivaraam
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads