pub struct WriteOutcome {
pub num_objects: u32,
pub pack_id: ObjectId,
pub bytes_written: u64,
pub objects_copied_from_pack: usize,
pub objects_recompressed: usize,
pub objects_deltified: usize,
pub thin_bases_offered: usize,
pub thin_bases_vetoed: usize,
pub closure_bases_declined: usize,
}Expand description
What one packfile emission produced.
Filled in from the engine’s own PackStats on the way out of
GitServe::emit_pack, so every
number is read back off what the engine reported rather than restated from
what was asked for.
No Default, and that is a property rather than an omission: ObjectId
has none, and an outcome with a zeroed pack id is one that claims a pack was
written and cannot name it. gunnar-pack’s own WriteOutcome refused the
same shape for the same reason.
Fields§
§num_objects: u32How many objects the pack contains. Zero is legal.
pack_id: ObjectIdThe pack’s identity: the checksum over every byte preceding it, which is
also the pack’s trailing bytes and the pack-<id>.pack name git gives
it.
bytes_written: u64Total bytes written, header and trailer included.
objects_copied_from_pack: usizeObjects whose already-deflated pack entry was copied verbatim: no inflate, no deflate, delta chains preserved.
This and the next field are pack-copy’s applied output. A byte count and a
wall clock cannot tell a pack-copy from a re-deflate; these two can, and
the day an engine starts re-deflating, objects_recompressed climbs
instead of a test staying green.
objects_recompressed: usizeObjects the engine deflated from their decompressed content.
objects_deltified: usizeObjects emitted as a newly computed delta against another object in the same pack.
Zero on the serve path, which reuses the pushing client’s deltas and has
no encoder. It exists because bytes_written alone cannot tell a
deltified pack from a whole-object one: on 2026-08-03 the client shipped
407.08 MiB of pack at 0.0% deltified while every byte count, wall
clock and correctness test in the tree was green.
thin_bases_offered: usizeThin-delta bases the engine offered — entries copied as an
OBJ_REF_DELTA naming a base outside this pack.
§Why the offer is counted and not only the refusal
objects_recompressed says how many objects lost their delta, and
cannot say how many could have kept it. A voucher that refuses
everything and a transfer that had no thin deltas to begin with produce
the same recompressed count and are opposite situations. The refusal
rate — thin_bases_vetoed over this — is the number that tells them
apart, and no other field here can be made to yield it.
thin_bases_vetoed: usizeOf those, the ones the client_has voucher would not vouch for, whose
objects were therefore written whole.
closure_bases_declined: usizeDeltas a base closure declined because the base it would have named is an object this pack already carries, at a location in another pack of a multi-pack store.
Zero on a single-pack store, on a negotiated fetch and whenever the closure is off.