Git development
 help / color / mirror / Atom feed
From: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
To: Patrick Steinhardt <ps@pks.im>, git@vger.kernel.org
Subject: Re: [PATCH 5/6] object-file: stop including "odb/source-loose.h"
Date: Tue, 10 Nov 2026 21:43:09 +0530	[thread overview]
Message-ID: <24939fc5-53aa-45b6-9e4c-249c5989b42b@gmail.com> (raw)
In-Reply-To: <20261102-pks-odb-loose-cleanups-v1-5-fbbc86c29693@pks.im>

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


  reply	other threads:[~2026-11-10 16:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24939fc5-53aa-45b6-9e4c-249c5989b42b@gmail.com \
    --to=kaartic.sivaraam@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox