pub struct PackBuildOptions {
pub thin: bool,
pub delta: bool,
pub window: usize,
pub max_depth: usize,
pub use_ofs_delta: bool,
pub respect_islands: bool,
pub reuse_deltas: bool,
pub reuse_objects: bool,
pub use_bitmaps: bool,
}Expand description
Options controlling pack-objects output (also used by build_pack).
Fields§
§thin: boolBuild a thin pack: allow deltas whose base is reachable from the haves
but not emitted in the pack (REF_DELTA against a peer-held base).
delta: boolEmit delta-compressed objects instead of whole objects only.
window: usizeCandidate bases per object (Git --window). 0 disables new deltas.
max_depth: usizeMaximum delta chain depth (Git --depth). 0 stores whole objects.
use_ofs_delta: boolPrefer OFS_DELTA when the base precedes the target in the pack stream.
respect_islands: boolHonor pack.island delta-island rules when selecting bases.
reuse_deltas: boolReuse on-disk delta edges when both target and base are in this pack.
reuse_objects: boolReuse verbatim packed bytes for whole objects (CRC32-guarded v2 indexes).
use_bitmaps: boolUse pack reachability bitmaps for object enumeration when present.
Implementations§
Source§impl PackBuildOptions
impl PackBuildOptions
Sourcepub fn window_and_depth_from_config(cfg: Option<&ConfigSet>) -> (usize, usize)
pub fn window_and_depth_from_config(cfg: Option<&ConfigSet>) -> (usize, usize)
pack.window and pack.depth from config, or Git defaults when unset.
Sourcepub fn for_local_copy(cfg: Option<&ConfigSet>) -> Self
pub fn for_local_copy(cfg: Option<&ConfigSet>) -> Self
Production pack settings for a local full copy (clone/fetch from disk).
Sourcepub fn for_repack_rewrite(cfg: Option<&ConfigSet>) -> Self
pub fn for_repack_rewrite(cfg: Option<&ConfigSet>) -> Self
Copy stored pack entries (whole objects and deltas) without a new delta search
(window 0), for rebuilding a pack from objects that are already packed.
Sourcepub fn for_serve(
cfg: Option<&ConfigSet>,
thin: bool,
use_ofs_delta: bool,
) -> Self
pub fn for_serve( cfg: Option<&ConfigSet>, thin: bool, use_ofs_delta: bool, ) -> Self
Pack settings for answering a fetch (upload-pack).
Window and depth follow pack.window / pack.depth. Whole objects and deltas
already in the repository’s packs are copied as they are, and the delta search
only covers blobs that are not already stored as a delta, as Git does when serving.
Like Git, pack.depth = 0 only disables new deltas: existing on-disk deltas are
still sent.
§Parameters
cfg— repository config, orNonefor Git’s defaults.thin— build a thin pack; passtrueonly when the client negotiatedthin-packand holds objects (senthaves), since a thin pack against nothing gains nothing.use_ofs_delta— whether the client negotiatedofs-delta.
Sourcepub fn for_local_push(cfg: Option<&ConfigSet>) -> Self
pub fn for_local_push(cfg: Option<&ConfigSet>) -> Self
Production pack settings for an incremental in-process local push.
Uses a thin pack when the remote already has objects to delta against.
Initial pushes into an empty bare repo should use Self::for_local_copy.