From: Johannes Berg <johannes@sipsolutions.net>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org, Derrick Stolee <stolee@gmail.com>,
Jeff King <peff@peff.net>
Subject: Re: [PATCH v3] multi-pack-index: fix *.rev cleanups with --object-dir
Date: Tue, 24 Aug 2021 09:50:41 +0200 [thread overview]
Message-ID: <255fb1277db09f66e5cfddc6bbe34181effca3dc.camel@sipsolutions.net> (raw)
In-Reply-To: <YSQ7wVKbE2HTkEz0@nand.local>
On Mon, 2021-08-23 at 20:22 -0400, Taylor Blau wrote:
>
> > + rev="objdir-test-repo/$objdir/pack/multi-pack-index-abcdef123456.rev" &&
> > + touch $rev &&
>
> This is the only non-obvious part of the patch, but is necessary because
> there's no way to trigger the MIDX code to write a reverse index
> (thankfully so, since this means that we're not affecting anybody in the
> wild cleaning up .rev's that we shouldn't be).
>
> It may be worth returning to this in the future when we have support for
> MIDX bitmaps (which will trigger writing a .rev file)
No argument there, though it doesn't matter much for this test how you
arrive at a repo that has a .rev file.
> > + nongit git multi-pack-index --object-dir="$(pwd)/objdir-test-repo/$objdir" write &&
> > + test_path_is_file objdir-test-repo/$objdir/pack/multi-pack-index &&
> > + test_path_is_missing $rev
>
> Makes sense. There's no point in testing that we ignore a .rev file in
> the outer repository, since we're using nongit to trigger this bug.
>
> But it may be worth adding an additional test which doesn't use nongit,
> and instead invokes 'git multi-pack-index' from a Git repository, but
> points at another repo's object directory. That should give us some
> confidence that we're not deleting .rev files that we shouldn't.
Maybe you can just send that as a separate follow-up patch? :)
I'm not _entirely_ sure what you'd want to test, you could do at least
these things:
* test like this that the correct file is deleted, from another repo
instead of nongit
* additionally arrange the *other* repo to have a .rev file and check
that it's *not* deleted?
But to me all of the three (including my test) seem quite equivalent, at
least as long as we assume that the code won't grow a "try to delete all
the .rev files anywhere I can find" thing :)
johannes
prev parent reply other threads:[~2021-08-24 7:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-23 17:10 [PATCH v3] multi-pack-index: fix *.rev cleanups with --object-dir Johannes Berg
2021-08-23 22:44 ` Junio C Hamano
2021-08-24 7:59 ` Johannes Berg
2021-08-24 19:01 ` Junio C Hamano
2021-08-24 0:22 ` Taylor Blau
2021-08-24 7:50 ` Johannes Berg [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=255fb1277db09f66e5cfddc6bbe34181effca3dc.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=git@vger.kernel.org \
--cc=me@ttaylorr.com \
--cc=peff@peff.net \
--cc=stolee@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).