Git development
 help / color / mirror / Atom feed
From: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/6] object-file: move logic to derive loose object paths into backend
Date: Tue, 10 Nov 2026 18:58:34 +0530	[thread overview]
Message-ID: <1161ae1f-6639-4e27-8832-3771f73f5e79@gmail.com> (raw)
In-Reply-To: <20261102-pks-odb-loose-cleanups-v1-2-fbbc86c29693@pks.im>

On 11/2/26 16:50, Patrick Steinhardt wrote:
> The logic to derive the filesystem path of a loose object is contained
> in "object-file.c" even though it's an implementation detail of the
> "loose" backend. Move the logic into the "loose" backend accordingly.
> While at it, inline the call to `fill_loose_path()`.
> 
> Ideally, we'd be able to remove the externally-visible declaration. But
> unfortunately, we still require access to that function for use in the
> dumb transport so that it can derive the target path for downloaded
> objects. This will need to get abstracted eventually, but for now we
> simply continue to expose the function.
>

This is well explained.
> diff --git a/odb/source-loose.c b/odb/source-loose.c
> index 96fc2ed213f..0f29162d752 100644
> --- a/odb/source-loose.c
> +++ b/odb/source-loose.c
> @@ -18,6 +18,27 @@
>   #include "tempfile.h"
>   #include "write-or-die.h"
>   
> +const char *odb_loose_path(struct odb_source_loose *loose,
> +			   struct strbuf *buf,
> +			   const struct object_id *oid)
> +{
> +	static const char hex[] = "0123456789abcdef";
> +

The hex[] gained a const while moving but that looks obviously correct.

Rest of the move looks good to me. We didn't lose anything. One thing I 
noticed is that http-walker.c no longer needs the object-file.c include 
now. So, we could also include the following in this patch:

diff --git a/http-walker.c b/http-walker.c
index 13730a2784..05c0262810 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -9,7 +9,6 @@
  #include "list.h"
  #include "transport.h"
  #include "packfile.h"
-#include "object-file.h"
  #include "odb.h"
  #include "odb/source-loose.h"

-- 
Sivaraam


  reply	other threads:[~2026-11-10 13:28 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 [this message]
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

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=1161ae1f-6639-4e27-8832-3771f73f5e79@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