Re: [PATCH v4 13/13] midx: implement writing incremental MIDX bitmaps
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Mar 20, 2025, 00:14 UTC
- Message-ID
- <Z9td64AzrXcRZmzq@nand.local>
- In-Reply-To
- <20250318021605.GC1473033@coredump.intra.peff.net>
On Mon, Mar 17, 2025 at 10:16:05PM -0400, Jeff King wrote:
Show 37 quoted lines
> On Fri, Mar 14, 2025 at 04:19:00PM -0400, Taylor Blau wrote:
>
> > +write_midx_layer () {
> > + n=1
> > + if test -f $midx_chain
> > + then
> > + n="$(($(wc -l <$midx_chain) + 1))"
> > + fi
> > +
> > + for i in 1 2
> > + do
> > + test_commit $n.$i &&
> > + git repack -d || return 1
> > + done &&
> > + git multi-pack-index write --bitmap --incremental
> > +}
> > +
> > +test_expect_success 'write initial MIDX layer' '
> > + git repack -ad &&
> > + write_midx_layer
> > +'
> > +
> > +test_expect_success 'read bitmap from first MIDX layer' '
> > + git rev-list --test-bitmap 1.2
> > +'
> > +
> > +test_expect_success 'write another MIDX layer' '
> > + write_midx_layer
> > +'
> > +
> > +test_expect_success 'midx verify with multiple layers' '
> > + git multi-pack-index verify
> > +'
>
> Perhaps a silly suggestion, but do you want to confirm in one of these
> tests that there are in fact multiple layers of bitmaps? (I expect it to
> be true, but just trying to cover all bases in the test).I don't think it's a silly suggestion. As you note, we do implicitly check it further down, but doing something like the following
test_path_is_dir "$midx_chain" &&
test_line_count = 2 "$midx_chain" &&explicitly before calling 'git multi-pack-index verify' would be nice to have.
Thanks, Taylor