gix_merge::blob

Struct Driver

Source
pub struct Driver {
    pub name: BString,
    pub display_name: BString,
    pub command: BString,
    pub recursive: Option<BString>,
}
Expand description

Define a driver program that performs a three-way merge.

Some values are related to diffing, some are related to conversions.

Fields§

§name: BString

The name of the driver, as referred to by [merge "name"] in the git configuration.

§display_name: BString

The human-readable version of name, only to be used for displaying driver-information to the user.

§command: BString

The command to execute to perform the merge entirely like <command> %O %A %B %L %P %S %X %Y.

  • %O
    • the common ancestor version, or base.
  • %A
    • the current version, or ours.
  • %B
    • the other version, or theirs.
  • %L
    • The conflict-marker size as positive number.
  • %P
    • The path in which the merged result would be stored, as workspace-relative path, of the current/ours side.
  • %S
    • The conflict-label for the common ancestor or base.
  • %X
    • The conflict-label for the current version or ours.
  • %Y
    • The conflict-label for the other version or theirs.

Note that conflict-labels are behind the conflict markers, to annotate them.

A typical invocation with all arguments substituted could then look like this:

<driver-program> .merge_file_nR2Qs1 .merge_file_WYXCJe .merge_file_UWbzrm 7 file e2a2970 HEAD feature

The driver is expected to leave its version in the file at %A, by overwriting it.

§recursive: Option<BString>

If true, this is the name of the driver to use when a virtual-merge-base is created, as a merge of all available merge-bases if there are more than one.

This value can also be special built-in drivers named text, binary or union. Note that user-defined drivers with the same name will be preferred over built-in ones, but only for files whose git attributes specified the driver by name.

Trait Implementations§

Source§

impl Clone for Driver

Source§

fn clone(&self) -> Driver

Returns a copy 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 Driver

Source§

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

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

impl Default for Driver

Source§

fn default() -> Driver

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

impl PartialEq for Driver

Source§

fn eq(&self, other: &Driver) -> 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 Eq for Driver

Source§

impl StructuralPartialEq for Driver

Auto Trait Implementations§

§

impl Freeze for Driver

§

impl RefUnwindSafe for Driver

§

impl Send for Driver

§

impl Sync for Driver

§

impl Unpin for Driver

§

impl UnwindSafe for Driver

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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

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.