Re: [PATCH 06/16] odb: move kept cache into `struct packfile_store`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 19, 2025, 18:56 UTC
- Message-ID
- <xmqq8qjfdts9.fsf@gitster.g>
- In-Reply-To
- <20250819-b4-pks-packfiles-store-v1-6-1660842e125a@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 27 quoted lines
> The object database tracks a cache of "kept" packfiles, which is used by
> git-pack-objects(1) to handle cruft objects. With the introduction of
> the `struct packfile_store` we have a better place to host this cache
> though.
>
> Move the cache accordingly.
>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> odb.h | 9 +--------
> packfile.c | 16 ++++++++--------
> packfile.h | 5 +++++
> 3 files changed, 14 insertions(+), 16 deletions(-)
>
> diff --git a/odb.h b/odb.h
> index 2dc3bdc79d..f1736b067c 100644
> --- a/odb.h
> +++ b/odb.h
> @@ -124,17 +124,10 @@ struct object_database {
> unsigned commit_graph_attempted : 1; /* if loading has been attempted */
>
> /*
> - * private data
> - *
> - * should only be accessed directly by packfile.c
> + * Should only be accessed directly by packfile.c
> */Hmph, would this be better done in the step [01/16]? Or did the removal of kept_pack_cache make the last piece of "private data" disappear with this step?
Show 10 quoted lines
> struct packfile_store *packfiles;
>
> - struct {
> - struct packed_git **packs;
> - unsigned flags;
> - } kept_pack_cache;
> -
> /*
> * This is meant to hold a *small* number of objects that you would
> * want odb_read_object() to be able to return, but yet you do not want