]> git.ipfire.org Git - thirdparty/git.git/commit - midx.h
pack-revindex: write multi-pack reverse indexes
authorTaylor Blau <me@ttaylorr.com>
Tue, 30 Mar 2021 15:04:32 +0000 (11:04 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Apr 2021 20:07:37 +0000 (13:07 -0700)
commit38ff7cabb6b8e51df78ce20c20632eba24265ee4
treeaacf2cb30864381b1a95d33aeb05125107ea7641
parenta587b5a7869e9a399d4de6edea0b3f32a3548639
pack-revindex: write multi-pack reverse indexes

Implement the writing half of multi-pack reverse indexes. This is
nothing more than the format describe a few patches ago, with a new set
of helper functions that will be used to clear out stale .rev files
corresponding to old MIDXs.

Unfortunately, a very similar comparison function as the one implemented
recently in pack-revindex.c is reimplemented here, this time accepting a
MIDX-internal type. An effort to DRY these up would create more
indirection and overhead than is necessary, so it isn't pursued here.

Currently, there are no callers which pass the MIDX_WRITE_REV_INDEX
flag, meaning that this is all dead code. But, that won't be the case
for long, since subsequent patches will introduce the multi-pack bitmap,
which will begin passing this field.

(In midx.c:write_midx_internal(), the two adjacent if statements share a
conditional, but are written separately since the first one will
eventually also handle the MIDX_WRITE_BITMAP flag, which does not yet
exist.)

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
midx.c
midx.h