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 T)

🔬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.