git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Taylor Blau <me@ttaylorr.com>
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: Sun, 2 Jul 2023 09:11:17 -0400	[thread overview]
Message-ID: <20230702131117.GB1036686@coredump.intra.peff.net> (raw)
In-Reply-To: <ZJ1N2I6sDfxhrJo8@nand.local>

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).

> [...]
> 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).

-Peff

  reply	other threads:[~2023-07-02 13:13 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 [this message]
2023-07-10 19:39       ` 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

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

  git send-email \
    --in-reply-to=20230702131117.GB1036686@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.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).