git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Meet Soni <meetsoni3017@gmail.com>
Cc: git@vger.kernel.org, shejialuo@gmail.com, gitster@pobox.com
Subject: Re: [GSoC][PATCH v4 1/9] refs: add a generic 'optimize' API
Date: Wed, 24 Sep 2025 08:18:32 +0200	[thread overview]
Message-ID: <aNONOM4W7kUQNm1y@pks.im> (raw)
In-Reply-To: <20250919082647.535213-2-meetsoni3017@gmail.com>

On Fri, Sep 19, 2025 at 01:56:39PM +0530, Meet Soni wrote:
> The existing `pack-refs` API is conceptually tied to the 'files'
> backend, but its behavior is generic (e.g., it triggers compaction for
> reftable). This naming is confusing.
> 
> Introduce a new generic refs_optimize() API that dispatches to a
> backend-specific implementation via a new 'optimize' vtable method.
> 
> This lays the architectural groundwork for different reference backends
> (like 'files' and 'reftable') to provide their own storage optimization
> logic, which will be called from a single, generic entry point.

I agree with this change in the architecture in general -- "packing
refs" is certainly a term that is specific to the "files" backend. So
renaming that infrastructure to instead say "optimizing refs" feels like
a sensible step as it adjusts naming to reality.

But what I don't quite get is why we end up with both a `pack_refs_fn`
and an `optimize_fn` after this series, where the latter is always
calling the former. Wouldn't it be more sensible step to make this a
couple of simple renames? E.g.:

  - `pack_refs_fn` -> `optimize_refs_fn`
  - `refs_pack_refs()` -> `refs_optimize()`
  - `struct pack_refs_opts` -> `struct refs_optimize_opts`

It would probably be a bit of the bigger patch to do all these renames
at once. But there aren't _that_ many users of this infra, and I'd quite
welcome those changes.

Patrick

  reply	other threads:[~2025-09-24  6:18 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-06  7:51 [GSoC][PATCH v2 0/5] Add refs optimize subcommand Meet Soni
2025-09-06  7:51 ` [GSoC][PATCH v2 1/5] builtin/pack-refs: factor out core logic into a shared library Meet Soni
2025-09-06  7:51 ` [GSoC][PATCH v2 2/5] doc: factor out common option Meet Soni
2025-09-08 16:44   ` Junio C Hamano
2025-09-06  7:51 ` [GSoC][PATCH v2 3/5] builtin/refs: add optimize subcommand Meet Soni
2025-09-06  7:51 ` [GSoC][PATCH v2 4/5] t0601: refactor tests to be shareable Meet Soni
2025-09-06  7:51 ` [GSoC][PATCH v2 5/5] t: add test for git refs optimize subcommand Meet Soni
2025-09-08 14:07 ` [GSoC][PATCH v2 0/5] Add " Junio C Hamano
2025-09-08 16:41   ` Junio C Hamano
2025-09-18  5:46 ` [GSoC][PATCH v3 0/9] " Meet Soni
2025-09-18  5:46   ` [GSoC][PATCH v3 1/9] refs: add a generic 'optimize' API Meet Soni
2025-09-18 10:44     ` shejialuo
2025-09-18 15:39       ` Junio C Hamano
2025-09-18  5:46   ` [GSoC][PATCH v3 2/9] files-backend: implement 'optimize' action Meet Soni
2025-09-18  5:46   ` [GSoC][PATCH v3 3/9] reftable-backend: " Meet Soni
2025-09-18  5:46   ` [GSoC][PATCH v3 4/9] builtin/pack-refs: convert to use the generic refs_optimize() API Meet Soni
2025-09-18 10:43     ` shejialuo
2025-09-18  5:47   ` [GSoC][PATCH v3 5/9] builtin/pack-refs: factor out core logic into a shared library Meet Soni
2025-09-18  5:47   ` [GSoC][GSoC][PATCH v3 6/9] doc: pack-refs: factor out common options Meet Soni
2025-09-18  5:47   ` [GSoC][PATCH v3 7/9] builtin/refs: add optimize subcommand Meet Soni
2025-09-18 16:06     ` Junio C Hamano
2025-09-18  5:47   ` [GSoC][PATCH v3 8/9] t0601: refactor tests to be shareable Meet Soni
2025-09-18  5:47   ` [GSoC][PATCH v3 9/9] t: add test for git refs optimize subcommand Meet Soni
2025-09-19  8:26   ` [GSoC][PATCH v4 0/9] Add " Meet Soni
2025-09-19  8:26     ` [GSoC][PATCH v4 1/9] refs: add a generic 'optimize' API Meet Soni
2025-09-24  6:18       ` Patrick Steinhardt [this message]
2025-09-19  8:26     ` [GSoC][PATCH v4 2/9] files-backend: implement 'optimize' action Meet Soni
2025-09-19  8:26     ` [GSoC][PATCH v4 3/9] reftable-backend: " Meet Soni
2025-09-19  8:26     ` [GSoC][PATCH v4 4/9] builtin/pack-refs: convert to use the generic refs_optimize() API Meet Soni
2025-09-19  8:26     ` [GSoC][PATCH v4 5/9] builtin/pack-refs: factor out core logic into a shared library Meet Soni
2025-09-24  6:18       ` Patrick Steinhardt
2025-09-19  8:26     ` [GSoC][PATCH v4 6/9] doc: pack-refs: factor out common options Meet Soni
2025-09-19  8:26     ` [GSoC][PATCH v4 7/9] builtin/refs: add optimize subcommand Meet Soni
2025-09-19  8:26     ` [GSoC][PATCH v4 8/9] t0601: refactor tests to be shareable Meet Soni
2025-09-19  8:26     ` [GSoC][PATCH v4 9/9] t: add test for git refs optimize subcommand Meet Soni
2025-09-19 18:43     ` [GSoC][PATCH v4 0/9] Add " Junio C Hamano

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=aNONOM4W7kUQNm1y@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=meetsoni3017@gmail.com \
    --cc=shejialuo@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).