public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Toon Claes <toon@iotcl.com>
To: Patrick Steinhardt <ps@pks.im>, git@vger.kernel.org
Cc: Taylor Blau <me@ttaylorr.com>
Subject: Re: [PATCH 2/5] repack-geometry: extract function to compute repacking split
Date: Wed, 14 Jan 2026 13:24:53 +0100	[thread overview]
Message-ID: <87qzrsjsa2.fsf@iotcl.com> (raw)
In-Reply-To: <20260105-pks-geometric-repack-with-promisors-v1-2-c4660573437e@pks.im>

Patrick Steinhardt <ps@pks.im> writes:

> We're about to add a second caller that wants to compute the repacking
> split for a set of packfiles. Split out the function that computes this
> split to prepare for that.
>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
>  repack-geometry.c | 39 +++++++++++++++++++++------------------
>  1 file changed, 21 insertions(+), 18 deletions(-)
>
> diff --git a/repack-geometry.c b/repack-geometry.c
> index b3e32cd07e..17e6652a91 100644
> --- a/repack-geometry.c
> +++ b/repack-geometry.c
> @@ -78,33 +78,32 @@ void pack_geometry_init(struct pack_geometry *geometry,
>  	strbuf_release(&buf);
>  }
>  
> -void pack_geometry_split(struct pack_geometry *geometry)
> +static uint32_t compute_pack_geometry_split(struct packed_git **pack, size_t pack_nr,
> +					    int split_factor)
>  {
>  	uint32_t i;
>  	uint32_t split;
>  	off_t total_size = 0;
>  
> -	if (!geometry->pack_nr) {
> -		geometry->split = geometry->pack_nr;
> -		return;
> -	}
> +	if (!pack_nr)
> +		return 0;

Thanks for making this easier to read now. Took me a while to realize
they behave identical.


-- 
Cheers,
Toon

  reply	other threads:[~2026-01-14 12:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 13:16 [PATCH 0/5] builtin/repack: make geometric repacking compatible with promisors Patrick Steinhardt
2026-01-05 13:16 ` [PATCH 1/5] builtin/pack-objects: exclude promisor objects with "--stdin-packs" Patrick Steinhardt
2026-01-09 23:32   ` Taylor Blau
2026-01-12  9:37     ` Patrick Steinhardt
2026-01-05 13:16 ` [PATCH 2/5] repack-geometry: extract function to compute repacking split Patrick Steinhardt
2026-01-14 12:24   ` Toon Claes [this message]
2026-01-05 13:16 ` [PATCH 3/5] repack-promisor: extract function to finalize repacking Patrick Steinhardt
2026-01-05 13:16 ` [PATCH 4/5] repack-promisor: extract function to remove redundant packs Patrick Steinhardt
2026-01-09 23:40   ` Taylor Blau
2026-01-05 13:16 ` [PATCH 5/5] builtin/repack: handle promisor packs with geometric repacking Patrick Steinhardt
2026-01-14 15:26   ` Toon Claes

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=87qzrsjsa2.fsf@iotcl.com \
    --to=toon@iotcl.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=ps@pks.im \
    /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