Result of a bitmap-assisted reachability walk: pack-position bits for
in-pack objects plus the “extended” objects encountered outside the
bitmapped pack (in first-seen order, like upstream’s extended index).
Pack-writing policy specific to the unreachable-object side of a cruft
repack. Keeping this separate from RepackOptions lets callers resolve
command/config precedence once while the engine applies the same policy to
both the surviving and expired cruft packs.
One registered .idx/.pack pair from a pack directory. The index is parsed
when the registry snapshot is built; pack bytes and per-pack decode/header
caches hang directly off this record so repeated object lookups do not bounce
through path-keyed maps.
A pack’s .bitmap loaded for consultation: oid <-> pack-position mappings,
resolved (XOR-expanded) per-commit reachability bitsets, and the four object
type bitmaps. Bit numbering follows pack order throughout.
Optional extensions for a reachability bitmap write. The hash cache is in
oid-sorted index order (pack index or MIDX OIDL order), independent of the
bitmap’s pack-order bit numbering.
Result of one reachable transfer installation. object_count describes
equal work independently of storage policy: it is retained when a small
transfer is unpacked into loose objects and install is therefore None.
Assemble a pack stream that reuses an existing pack’s object data verbatim
(upstream pack-objects’ “pack reuse” fast path, full-pack case) and appends
appended as freshly encoded undeltified entries.
Computes the set of objects reachable from roots using stored bitmaps
where available and a fill-in object walk where not — the consult half of
the bitmap engine (upstream find_objects + fill_in_bitmap).
Compute wants minus haves using the selected have-side bitmap traversal.
The trace2 region is emitted here, around real bitmap-engine work, so every
transport/CLI consumer observes the same strategy decision.
Build and install a filtered transfer pack with an explicit promised-object
policy. The omission mode is reserved for a server whose client accepted a
protocol-v2 promisor-remote advertisement.
Build and install a filtered transfer pack, optionally considering objects
from the client’s negotiated have closure as external thin-pack bases.
Candidate selection is bounded per object type and deterministic so a large
client repository cannot turn delta planning into an unbounded comparison.
Build the protocol-visible empty cruft pack emitted by pack-objects when
expiration removes every candidate. Repository-level repack callers omit
empty cruft output, but the plumbing command still prints a pack name and
writes an empty .mtimes sidecar.
build_pack_bitmap’s multi-pack sibling: builds the serialised
multi-pack-index-<checksum>.bitmap for midx_entries, with bits in
pseudo-pack order (preferred pack first, then pack id, then offset — the
same order MultiPackIndex::write_with_reverse_index records in RIDX)
and the midx checksum in the BITM checksum field.
Serialize one already-selected MIDX layer, including its optional bitmap
and reverse index. Incremental compaction uses this after remapping entries
from several source layers into a single pack table.
Build a self-contained pack of the objects reachable from starts (excluding
excluded) with a partial-clone filter applied, returning the packed bytes
without installing them. This is the upload-pack server’s counterpart to
build_reachable_pack: it honors filter blob:none / blob:limit=<n> /
tree:<depth> requests so a filtered fetch omits the corresponding objects.
collect_reachable_object_ids with a stop set: objects in excluded are
not visited and not expanded, so the walk never sees anything reachable only
through them (used to truncate history at a shallow boundary).
collect_reachable_object_ids with a cut set: commits in cut are
collected, but the walk does not continue to their parents — the view a
shallow repository has of its own refs ($GIT_DIR/shallow of the other
side, threaded explicitly because reader belongs to this side).
Parents of a parsed commit with the graft seam applied: empty when the
reader cuts history at oid (shallow boundary), the raw parsed parents
otherwise.
Install a repack_cruft result: write the reachable pack and the cruft
.mtimes pack, then under prune remove the superseded non-cruft packs, old
cruft packs, and the loose objects now served.
Install an optional expired-object backup before committing the source
cruft repack. Every output is validated before either destination is
mutated; a destination failure therefore leaves all source packs intact.
Install a repack_geometric result: write the new pack, then under prune
remove EXACTLY the rolled-up packs (those below the geometric split) plus the
loose objects now packed. Unlike install_repack_result, packs left in
place above the split are never removed even though some of their objects may
also live in the new pack.
Write the consolidated pack from a RepackResult into
objects/pack/ and, when prune is set, remove the now-redundant
pre-existing packs and packed loose objects.
install_repack_result that additionally writes a pack-<checksum>.bitmap
reachability bitmap alongside the new pack when bitmap_tips is Some.
bitmap_tips carries the repository’s ref tips (peeled to commits): they
receive selection preference, mirroring upstream’s NEEDS_BITMAP flagging of
ref tips in git repack -b / pack-objects --write-bitmap-index.
Loads the single-pack .bitmap of objects_dir/pack, if a valid one
exists. Scans pack-*.bitmap files (sorted, first valid wins, like
upstream’s “first bitmap” behaviour), requires the sibling .idx, and
verifies the recorded pack checksum. Any unreadable/corrupt bitmap yields
Ok(None) — consumers fall back to a regular object walk, mirroring
upstream’s warn-and-ignore on bitmap load failure.
Gather every object id on disk together with the best (max) mtime of any
copy: a packed object contributes its pack’s mtime (or its own recorded
mtime inside a cruft pack), a loose object contributes its file mtime.
Like prune_unreachable_loose, but missing links encountered while walking
reachable roots are ignored. git gc uses this mode for pre-existing broken
unreachable commits/trees/tags: the broken object itself is kept when recent,
but its absent children do not make housekeeping fail.
git repack --cruft [--cruft-expiration=<t>] [-d]: pack the reachable
closure of roots into one new pack, then collect every unreachable object
into a .mtimes-stamped cruft pack (honouring cruft_expiration). The
caller installs the result and, under -d, removes the superseded non-cruft
and old cruft packs.
Run a cruft repack while treating each explicit root and its closure as
recent. This additive entry point keeps the original
repack_cruft_with_pack_options signature stable for embedders.
git repack --geometric=<factor>: roll up the smallest packs (plus loose
unpacked objects) so the surviving packs form a geometric progression by
object count. Objects in the rolled-up packs and loose objects are gathered
into one new pack; packs at/above the split are left in place. The new pack
excludes objects already served by a left-alone pack.
Pack only loose objects that belong to the reachability closure of
roots. This is the engine for incremental git repack: unreachable loose
objects remain loose so a later cruft repack can timestamp and collect them.
Repack reachable objects while moving blobs at least limit bytes into a
separate pack named <filter_to>-<checksum>.{pack,idx}. This is the native
engine seam for repack --filter=blob:limit=<n> --filter-to=<prefix>.
Infallible adapter over the canonical resolver in sley_formats: on any
resolution failure (missing/unreadable paths) fall back to the raw git dir
rather than failing object-store access.
Write a reachable pack directly to writer while preserving retained-pack
entries. Large walks retain object metadata rather than every decoded body;
fresh objects are compressed through the pack writer’s bounded window, and
reused entries are copied to the destination as they are selected.