git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Jeff King <peff@peff.net>
Cc: Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, gitster@pobox.com,
	Derrick Stolee <derrickstolee@github.com>
Subject: Re: [PATCH] repack: only repack .packs that exist
Date: Mon, 10 Jul 2023 15:39:56 -0400	[thread overview]
Message-ID: <ZKxejN7JQDWpNTAz@nand.local> (raw)
In-Reply-To: <20230702131117.GB1036686@coredump.intra.peff.net>

On Sun, Jul 02, 2023 at 09:11:17AM -0400, Jeff King wrote:
> On Thu, Jun 29, 2023 at 05:24:40AM -0400, Taylor Blau wrote:
>
> > > I also kind of wonder if this repack code should simply be loading and
> > > iterating the packed_git list, but that is a much bigger change.
> >
> > I have wanted to do this for a while ;-). The minimal patch is less
> > invasive than I had thought:
>
> Yeah, I agree it's not too bad. If we want to go that route, though, I
> think we should do it on top of Stolee's patch, though (which makes it a
> pure cleanup once the behaviors are aligned).
>
> I'm also not sure if you'd need to do anything tricky with alternate
> object dirs (it looks like the existing code ignores them entirely, so I
> guess we'd want to skip entries without pack_local set).

Yep, we definitely want a `if (!p->is_local) continue` in there to be
consistent with the existing behavior.

> > [...]
> > I think you could probably go further than this, since having to store
> > the suffix-less pack names in the fname_kept and fname_nonkept lists is
> > kind of weird.
> >
> > It would be nice if we could store pointers to the actual packed_git
> > structs themselves in place of those lists instead, but I'm not
> > immediately sure how feasible it would be to do since we re-prepare the
> > object store between enumerating and then removing these packs.
>
> I think that would work, because we do not ever drop packed_git entries
> from the list (even if the files were deleted between prepare/reprepare).
> But it also creates a subtle memory ownership dependency/assumption
> between the two bits of code. It seems clearer to me to just copy the
> names out to our own lists here (i.e., the patch you showed).

Yeah, I agree. I thought that it might clean things up further, and to
an extent it does:

    https://github.com/ttaylorr/git/compare/tb/collect-packs-readdir

, but I think that the memory ownership issue is sufficiently subtle
that the clean-up isn't really worth it.

I put the above patch together with Stolee's, and sent the result back
to the list here:

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

Thanks,
Taylor

      reply	other threads:[~2023-07-10 19:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 19:03 [PATCH] repack: only repack .packs that exist Derrick Stolee via GitGitGadget
2023-06-21  9:01 ` Taylor Blau
2023-06-27  7:54 ` Jeff King
2023-06-29  9:24   ` Taylor Blau
2023-07-02 13:11     ` Jeff King
2023-07-10 19:39       ` Taylor Blau [this message]

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=ZKxejN7JQDWpNTAz@nand.local \
    --to=me@ttaylorr.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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).