git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Justin Tobler <jltobler@gmail.com>
Cc: Karthik Nayak <karthik.188@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/4] refs: move to using the '.optimize' functions
Date: Thu, 16 Oct 2025 12:37:02 +0200	[thread overview]
Message-ID: <aPDKzqT2YaG2NmEu@pks.im> (raw)
In-Reply-To: <zah4lafziwkqty2qw6erkbq3wfilfneom5vm6vcfqk5b644iff@rcebhmsrgmmd>

On Wed, Oct 15, 2025 at 05:05:46PM -0500, Justin Tobler wrote:
> On 25/10/15 11:25PM, Karthik Nayak wrote:
> > diff --git a/refs/debug.c b/refs/debug.c
> > index 01499b9033..40cd1d9c15 100644
> > --- a/refs/debug.c
> > +++ b/refs/debug.c
> > @@ -116,11 +116,11 @@ static int debug_transaction_abort(struct ref_store *refs,
> >  	return res;
> >  }
> >  
> > -static int debug_pack_refs(struct ref_store *ref_store, struct pack_refs_opts *opts)
> > +static int debug_optimize(struct ref_store *ref_store, struct pack_refs_opts *opts)
> >  {
> >  	struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store;
> > -	int res = drefs->refs->be->pack_refs(drefs->refs, opts);
> > -	trace_printf_key(&trace_refs, "pack_refs: %d\n", res);
> > +	int res = drefs->refs->be->optimize(drefs->refs, opts);
> > +	trace_printf_key(&trace_refs, "optimize: %d\n", res);
> >  	return res;
> >  }
> >  
> > @@ -430,7 +430,7 @@ struct ref_storage_be refs_be_debug = {
> >  	.transaction_finish = debug_transaction_finish,
> >  	.transaction_abort = debug_transaction_abort,
> >  
> > -	.pack_refs = debug_pack_refs,
> > +	.optimize = debug_optimize,
> 
> question: Was the debug backend not using either of these callbacks?
> From the commit message, it sounds like all the backends were using the
> optimize callback.

Doesn't look like it. Overall I kind of doubt the value that this
backend has. I have never had even a single use case for it, and I have
been working with references extensively over the last two or three
years by now.

Maybe we should just drop it eventually?

Patrick

  reply	other threads:[~2025-10-16 10:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15 21:25 [PATCH 0/4] refs: cleanup code around optimizations Karthik Nayak
2025-10-15 21:25 ` [PATCH 1/4] refs: move to using the '.optimize' functions Karthik Nayak
2025-10-15 22:05   ` Justin Tobler
2025-10-16 10:37     ` Patrick Steinhardt [this message]
2025-10-16 12:07       ` Karthik Nayak
2025-10-16 12:11         ` Patrick Steinhardt
2025-10-16 12:03     ` Karthik Nayak
2025-10-15 21:25 ` [PATCH 2/4] refs: cleanup code around optimization Karthik Nayak
2025-10-15 22:09   ` Justin Tobler
2025-10-15 21:25 ` [PATCH 3/4] refs: rename 'pack_refs_opts' to 'refs_optimize_opts' Karthik Nayak
2025-10-15 22:18   ` Justin Tobler
2025-10-16 12:15     ` Karthik Nayak
2025-10-15 21:25 ` [PATCH 4/4] t/pack-refs-tests: move the 'test_done' to callees Karthik Nayak
2025-10-16 10:38 ` [PATCH 0/4] refs: cleanup code around optimizations Patrick Steinhardt

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=aPDKzqT2YaG2NmEu@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=jltobler@gmail.com \
    --cc=karthik.188@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).