git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Victoria Dye <vdye@github.com>
Cc: Victoria Dye via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] repack: respect --keep-pack with geometric repack
Date: Fri, 20 May 2022 15:05:41 -0400	[thread overview]
Message-ID: <YofmhcBLrni0kY/s@nand.local> (raw)
In-Reply-To: <bb19159b-6d0c-a683-a58e-95ebdc128627@github.com>

On Fri, May 20, 2022 at 10:27:21AM -0700, Victoria Dye wrote:
> > I left a couple of small notes on the patch below, but since I have some
> > patches that deal with a separate issue in the `git repack --geometric`
> > code coming, do you want to combine forces (and I can send a
> > lightly-reworked version of this patch as a part of my series)?
>
> Works for me! I'm happy with all the suggested changes you noted below
> (moving the 'string_list_sort' and cleaning up the test), so feel free to
> include them in your series.
>
> Thanks!

No problem; I (re-)sent this patch as 1/3 in my series which should be
available via the archive at:

    https://lore.kernel.org/git/cover.1653073280.git.me@ttaylorr.com/T/#t

It looks like we're on the same page with respect to my suggestions, but
feel free to take a look at the reworked version of this patch (and the
new ones on top, too) and let me know what you think.

> >> @@ -332,17 +332,34 @@ static int geometry_cmp(const void *va, const void *vb)
> >>  	return 0;
> >>  }
> >>
> >> -static void init_pack_geometry(struct pack_geometry **geometry_p)
> >> +static void init_pack_geometry(struct pack_geometry **geometry_p,
> >> +			       struct string_list *existing_kept_packs)
> >>  {
> >>  	struct packed_git *p;
> >>  	struct pack_geometry *geometry;
> >> +	struct strbuf buf = STRBUF_INIT;
> >>
> >>  	*geometry_p = xcalloc(1, sizeof(struct pack_geometry));
> >>  	geometry = *geometry_p;
> >>
> >> +	string_list_sort(existing_kept_packs);
> >
> > Would it be worth sorting this as early as in collect_pack_filenames()?
> > For our purposes in this patch, this works as-is, but it may be
> > defensive to try and minimize the time that list has unsorted contents.
>
> I went back and forth on this, eventually settling on this to keep the
> 'string_list_sort' as close as possible to where the sorted list is needed.
> I'm still pretty indifferent, though, so moving it to the end of
> 'collect_pack_filenames()' is fine with me.

I'm fine with it either way. I opted to sorting the list in
collect_pack_filenames() since I think it's slightly more fool-proof,
but I also don't have strong feelings about its placement.

Thanks,
Taylor

  reply	other threads:[~2022-05-20 19:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20 16:36 [PATCH] repack: respect --keep-pack with geometric repack Victoria Dye via GitGitGadget
2022-05-20 17:00 ` Taylor Blau
2022-05-20 17:27   ` Victoria Dye
2022-05-20 19:05     ` Taylor Blau [this message]
2022-05-20 20:41   ` Junio C Hamano
2022-05-20 22:12     ` Junio C Hamano
2022-05-20 22:20       ` Taylor Blau
2022-05-20 23:26     ` Taylor Blau

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YofmhcBLrni0kY/s@nand.local \
    --to=me@ttaylorr.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=vdye@github.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).