Skip to main content

Module pack

Module pack 

Source
Expand description

The pack-shaped values the protocol carries. Vocabulary, not machinery.

§Why these live here and not in gunnar-pack

Every one of these types used to be gunnar_pack::…, and naming them was the last edge gunnar-wire had into a pack implementation. It was a vocabulary edge and never a call: nothing under gunnar-wire/src has called index_pack, PackWriter, write_pack_copy or gix_pack::data::output::entry::iter_from_counts since the engine seam landed — crate::upload_pack emits through GitServe::emit_pack and the receive path takes the bytes through a caller-supplied PackIngest whose only shipping implementation goes straight to GitOps::put_pack.

But cargo links what a manifest names, not what a call graph reaches. One pub struct field spelled gix_pack::data::Version was enough to put gix-pack — and behind it gix-diff, gix-traverse, gix-revwalk, gix-commitgraph, gix-fs, gix-tempfile, gix-path, gix-chunk, gix-zlib and gix-features/parallel — into every build of the appliance, including --no-default-features --features server,engine-znippy whose whole point is that the pack pipeline is not there.

So the vocabulary moved to the side that speaks it. These are the words receive-pack and upload-pack use to report what an engine did; the engine behind the contract is what actually did it, and which crate it used is its own business. gunnar-pack remains a dev-dependency of this crate, where it is what it always was for these tests: an outside oracle that indexes a pack gunnar produced and disagrees when gunnar is wrong.

§The residue, said out loud

ObjectId and Kind are still gix-hash’s. They are cheap value types — a 32-byte inline array and a two-variant enum — with no pipeline behind them, and the contract’s own Oid<'a> = &'a [u8] is a borrow, so it cannot be what an owned id in a returned struct is spelled as. Replacing them is a workspace-wide rename with no dependency payoff on its own, and it is not what this module is for.

Structs§

IndexedPack
What came out of taking a pushed pack into storage.
WriteOutcome
What one packfile emission produced.

Enums§

PackVersion
A packfile’s format version, as the four bytes after PACK say it.

Constants§

DEFAULT_ALLOC_LIMIT_BYTES
Ceiling on a single entry’s allocation while decoding an untrusted pack: 1 GiB.