Skip to main content

FetchRequest

Struct FetchRequest 

Source
pub struct FetchRequest {
    pub wants: Vec<ObjectId>,
    pub want_refs: Vec<String>,
    pub haves: Vec<ObjectId>,
    pub done: bool,
    pub thin_pack: bool,
    pub no_progress: bool,
    pub include_tag: bool,
    pub ofs_delta: bool,
    pub filter: Option<Filter>,
    pub wait_for_done: bool,
    pub shallow: ShallowRequest,
}
Expand description

The arguments of command=fetch, and of a v0 want section.

Fields§

§wants: Vec<ObjectId>

want <oid>.

§want_refs: Vec<String>

want-ref <name>, the ref-in-want feature.

§haves: Vec<ObjectId>

have <oid>.

§done: bool

done: stop negotiating and send the pack.

§thin_pack: bool

thin-pack, and since the thin-pack ruling this one is honoured, not ignored.

Pack-copy preserves the deltas the pushing client computed, but until 2026-08-04 only those whose base was also in the transfer: the rest were inflated and deflated whole, because allow_thin_pack: false will not point an entry at a base the receiver may not have. On a clone that costs nothing, since the transfer is the whole history and every base is in it. On a negotiated fetch it is the dominant cost — MEASURED 2026-08-04, 24 of 40 objects expanded and 3.98x stock git’s thin pack of the same object set.

What changed is not the caution, only what backs it: the walk that decides the transfer already knows what the client holds (graph::Selection::client_has), so a base can now be checked instead of assumed unsafe. A base that does not answer still costs its object the delta. See send_pack for the three gating conditions.

§no_progress: bool

no-progress.

§include_tag: bool

include-tag.

§ofs_delta: bool

ofs-delta, and since pack-copy this one is honoured, not ignored.

The pack-copy path emits an entry exactly as it found it in a pack, and most of those entries are ofs-deltas. A client that did not ask for ofs-delta cannot read them, so it gets whole objects instead. That is what git-upload-pack does too: it passes --delta-base-offset to pack-objects only when the client advertised the capability.

Every git since 2005 sends it and stock git 2.53.0 always does, so this is the fallback, not the path. It is a real fallback though, and tests/pack_copy.rs exercises it rather than assuming nobody lands there.

§filter: Option<Filter>

filter <spec>.

§wait_for_done: bool

wait-for-done.

§shallow: ShallowRequest

Everything shallow-related.

Implementations§

Source§

impl FetchRequest

Source

pub fn parse( lines: &[Vec<u8>], hash_kind: Kind, offered: Offered, ) -> Result<Self>

Parse the argument section of command=fetch.

Unknown arguments are an error rather than a shrug. The argument table in crate::caps is the same one the advertisement is generated from, so “accepted here” and “advertised there” cannot drift.

Trait Implementations§

Source§

impl Clone for FetchRequest

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 FetchRequest

Source§

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

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

impl Default for FetchRequest

Source§

fn default() -> Self

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

impl Eq for FetchRequest

Source§

impl PartialEq for FetchRequest

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FetchRequest

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more