Skip to main content

IntegrationReason

Enum IntegrationReason 

Source
pub enum IntegrationReason {
    SameCommit,
    Ancestor,
    NoAddedChanges,
    TreesMatch,
    MergeAddsNothing,
}
Expand description

Why branch content is considered integrated into the target branch.

Used by both wt list (for status symbols) and wt remove (for messages). Each variant corresponds to a specific integration check. In wt list, three symbols represent these checks:

  • _ for SameCommit with clean working tree (empty)
  • for SameCommit with dirty working tree
  • for all others (content integrated via different history)

The checks are ordered by cost (cheapest first):

  1. SameCommit - commit SHA comparison (~1ms)
  2. Ancestor - ancestor check (~1ms)
  3. NoAddedChanges - three-dot diff (~50-100ms)
  4. TreesMatch - tree SHA comparison (~100-300ms)
  5. MergeAddsNothing - merge simulation (~500ms-2s)

Variants§

§

SameCommit

Branch HEAD is literally the same commit as target.

Used by wt remove to determine if branch is safely deletable. In wt list, same-commit state is shown via MainState::Empty (_) or MainState::SameCommit () depending on working tree cleanliness.

§

Ancestor

Branch HEAD is an ancestor of target (target has moved past this branch).

Symbol in wt list:

§

NoAddedChanges

Three-dot diff (main...branch) shows no files. The branch has no file changes beyond the merge-base.

Symbol in wt list:

§

TreesMatch

Branch tree SHA equals target tree SHA. Commit history differs but file contents are identical.

Symbol in wt list:

§

MergeAddsNothing

Simulated merge (git merge-tree) produces the same tree as target. The branch has changes, but they’re already in target via a different path.

Symbol in wt list:

Implementations§

Source§

impl IntegrationReason

Source

pub fn description(&self) -> &'static str

Human-readable description for use in messages (e.g., wt remove output).

Returns a phrase that expects the target branch name to follow (e.g., “same commit as” + “main” → “same commit as main”).

Source

pub fn symbol(&self) -> &'static str

Status symbol used in wt list for this integration reason.

  • SameCommit_ (matches MainState::Empty)
  • Others → (matches MainState::Integrated)

Trait Implementations§

Source§

impl Clone for IntegrationReason

Source§

fn clone(&self) -> IntegrationReason

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for IntegrationReason

Source§

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

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

impl<'_derivative_strum> From<&'_derivative_strum IntegrationReason> for &'static str

Source§

fn from(x: &'_derivative_strum IntegrationReason) -> &'static str

Converts to this type from the input type.
Source§

impl From<IntegrationReason> for &'static str

Source§

fn from(x: IntegrationReason) -> &'static str

Converts to this type from the input type.
Source§

impl PartialEq for IntegrationReason

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for IntegrationReason

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for IntegrationReason

Source§

impl Eq for IntegrationReason

Source§

impl StructuralPartialEq for IntegrationReason

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.