🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.git
1 messages
1 total messages Started by Kaartic Sivaraam Tue, 10 Nov 2026 13:10
Re: [PATCH 1/6] object-file: move logic to read loose objects into backend
#2832
Author: Kaartic Sivaraam
Date: Tue, 10 Nov 2026 13:10
54 lines
12925 bytes
On 11/2/26 16:50, Patrick Steinhardt wrote:
> The logic to read loose objects is still contained in "object-file.c"
> even though it's an implementation detail of the "loose" backend, and
> that backend is nowadays also the only remaining caller.
> 
> Move the logic around and remove the accompanying declarations.
> 

The move looks justified as mentioned in the commit message.

> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
>   object-file.c      | 300 ---------------------------------------------------

All functions moved from object-file,c are properly moved over to 
odb/source-loose.c and they are marked static which is also appropriate.

>   object-file.h      |  45 --------
>   odb/source-loose.c | 306 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>   3 files changed, 306 insertions(+), 345 deletions(-)

> diff --git a/object-file.h b/object-file.h
> index f44758c4f8b..65ab44542b0 100644
> --- a/object-file.h
> +++ b/object-file.h
> @@ -21,7 +21,6 @@ enum {
>   int index_fd(struct index_state *istate, struct object_id *oid, int fd, struct stat *st, enum object_type type, const char *path, unsigned flags);
>   int index_path(struct index_state *istate, struct object_id *oid, const char *path, struct stat *st, unsigned flags);
>   
> -struct object_info;
>   struct odb_source;
>   
>   /*
> @@ -122,50 +121,6 @@ void hash_object_file(const struct git_hash_algo *algo, const void *buf,
>   int check_and_freshen_file(const char *fn, int freshen,
>   			   const time_t *mtime);
>   
> -/*
> - * Open the loose object at path, check its hash, and return the contents,
> - * use the "oi" argument to assert things about the object, or e.g. populate its
> - * type, and size. If the object is a blob, then "contents" may return NULL,
> - * to allow streaming of large blobs.
> - *
> - * Returns 0 on success, negative on error (details may be written to stderr).
> - */

We're losing these documentation comments during the move. Can we retain 
the same above the static functions in odb/source-loose.c?

Rest of the patch looks good to me.

-- 
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