From: Patrick Steinhardt <ps@pks.im>
To: karthik nayak <karthik.188@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] refs/files: use heuristic to decide whether to repack with `--auto`
Date: Tue, 3 Sep 2024 11:23:00 +0200 [thread overview]
Message-ID: <ZtbVbn5rxrmLFuNa@pks.im> (raw)
In-Reply-To: <CAOLa=ZRGvU4LvX9kjvF3dJCTvKR6CC1CwPTp515c3Wt5M8a5vA@mail.gmail.com>
On Tue, Sep 03, 2024 at 02:00:16AM -0700, karthik nayak wrote:
> Patrick Steinhardt <ps@pks.im> writes:
> > diff --git a/refs/files-backend.c b/refs/files-backend.c
> > index 1cff65f6ae5..261e2b8570f 100644
> > --- a/refs/files-backend.c
> > +++ b/refs/files-backend.c
> > @@ -1311,6 +1311,78 @@ static int should_pack_ref(struct files_ref_store *refs,
> > return 0;
> > }
> >
> > +static size_t fastlog2(size_t sz)
>
> Nit: We already `reftable/stack_test.c:fastlog2` and `bisect.c:log2i`. I
> wonder if it would be nice to consolidate all of them. But I guess it's
> okay, since the reftable code anyways is isolated from the rest of the
> Git code.
Yeah, the version we have here is in fact an (almost exact) copy of the
function in our reftable codebase. And as you note, we do not want to
deduplicate these such that the reftable library is somewhat isolated
from the rest of the codebase.
I also noticed `log2i()`, but honestly the only reason why I didn't
reuse it is that I had no clue where to put it. There isn't any header
that would be a good fit for it, and creating a new "math.h" header for
a single function felt overblown to me. So I decided to just not bother.
I'm happy to adjust though if somebody has a suggestion for where to put
it.
Patrick
next prev parent reply other threads:[~2024-09-03 9:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 13:48 [PATCH 0/2] refs/files: use heuristic to decide whether to repack with `--auto` Patrick Steinhardt
2024-09-02 13:48 ` [PATCH 1/2] t0601: merge tests for auto-packing of refs Patrick Steinhardt
2024-09-02 13:48 ` [PATCH 2/2] refs/files: use heuristic to decide whether to repack with `--auto` Patrick Steinhardt
2024-09-03 9:00 ` karthik nayak
2024-09-03 9:23 ` Patrick Steinhardt [this message]
2024-09-03 18:23 ` Junio C Hamano
2024-09-04 7:42 ` Patrick Steinhardt
2024-09-04 16:15 ` Junio C Hamano
2024-09-04 8:49 ` Patrick Steinhardt
2024-09-05 8:44 ` karthik nayak
2024-09-04 8:52 ` [PATCH v2 0/3] refs/files: use heuristics " Patrick Steinhardt
2024-09-04 8:53 ` [PATCH v2 1/3] wrapper: introduce `log2u()` Patrick Steinhardt
2024-09-04 8:53 ` [PATCH v2 2/3] t0601: merge tests for auto-packing of refs Patrick Steinhardt
2024-09-04 8:53 ` [PATCH v2 3/3] refs/files: use heuristic to decide whether to repack with `--auto` Patrick Steinhardt
2024-09-04 15:24 ` Junio C Hamano
2024-09-05 9:58 ` 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=ZtbVbn5rxrmLFuNa@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--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).