Skip to main content

RepackOptions

Struct RepackOptions 

Source
#[non_exhaustive]
pub struct RepackOptions {
Show 13 fields pub dry_run: bool, pub write_commit_graph: bool, pub write_bitmap: bool, pub prune_older_than: Option<OffsetDateTime>, pub now: Option<OffsetDateTime>, pub keep_unreachable: bool, pub threads: Option<usize>, pub pack_build: Option<PackBuildOptions>, pub merged_config: Option<ConfigSet>, pub environment: Environment, pub incremental: bool, pub auto_skip: bool, pub force_recompress: bool,
}
Expand description

Options for repack_all().

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§dry_run: bool

Report actions without writing packs or deleting files.

§write_commit_graph: bool

After repack, write objects/info/commit-graph when the ODB is files-backed.

§write_bitmap: bool

After repack, write a .bitmap sidecar for the new pack (files-backed only).

§prune_older_than: Option<OffsetDateTime>

When set, prune unreachable loose objects not newer than this instant after repack.

§now: Option<OffsetDateTime>

Wall clock passed to maintenance helpers that require an explicit time (e.g. bitmap writes).

§keep_unreachable: bool

When true (the default), do not delete unreachable loose objects after repack (matches git repack -ad).

§threads: Option<usize>

Worker threads for pack indexing (None reads pack.threads / CPU count).

§pack_build: Option<PackBuildOptions>

Override the delta settings of a full repack; None uses PackBuildOptions::for_local_copy (pack.window / pack.depth from config).

A full repack honors delta, window, max_depth, reuse_deltas, reuse_objects, use_ofs_delta and use_bitmaps. Objects already in a pack keep their stored form when the reuse flags allow it; only the rest go through the window search.

§merged_config: Option<ConfigSet>

Config/environment for ingest and pack threads (defaults to repo config).

§environment: Environment

Process environment for config discovery and thread counts.

§incremental: bool

Pack only the reachable loose objects into a new pack, keeping existing packs (Git repack -d without -a). Unreachable loose objects stay loose for the prune step.

When Self::write_bitmap is true and the repository already has pack files, bitmaps are written via a multi-pack-index sidecar instead of a per-pack .bitmap on the new pack alone.

§auto_skip: bool

When true, gc() may skip repack on a single pack with no loose objects when every packed object is still reachable and none would be dropped by the active prune policy. Explicit repack_all / repack leave this false so maintenance still runs.

§force_recompress: bool

When true, recompute every delta instead of keeping the ones stored in packs (git repack -f, grit repack --force). Whole objects that stay whole are still copied verbatim.

Implementations§

Source§

impl RepackOptions

Source

pub fn with_dry_run(dry_run: bool) -> Self

Start from Default::default with Self::dry_run set.

Trait Implementations§

Source§

impl Clone for RepackOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RepackOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RepackOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.