Thread View: linux.kernel.git
1 messages
1 total messages
Started by Kaartic Sivaraam
Tue, 10 Nov 2026 13:28
Re: [PATCH 2/6] object-file: move logic to derive loose object paths into backend
Author: Kaartic Sivaraam
Date: Tue, 10 Nov 2026 13:28
Date: Tue, 10 Nov 2026 13:28
50 lines
12493 bytes
12493 bytes
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
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