pub enum DiffSource {
Staged,
Unstaged,
Committed,
}Expand description
Which tree a stretch of diff text was produced against — the
answer MagitView::diff_source gives, and the only thing
hunk-level s / u / x need to know beyond the hunk itself.
Variants§
Staged
git diff --cached — HEAD vs the index. u reverses it out.
Unstaged
git diff — the index vs the working tree. s applies it in,
x reverses it out of the worktree.
Committed
MG.23g: a patch already in history — a commit’s git show, a
stash’s git stash show -p.
Neither s nor u can act on it: the change is not sitting
between two of this checkout’s trees, it is a description of
something that already happened. What it supports instead is
a — apply this one hunk to the working tree — and - —
reverse it back out. Cherry-picking or reverting one hunk of a
commit rather than the whole thing.
Trait Implementations§
Source§impl Clone for DiffSource
impl Clone for DiffSource
Source§fn clone(&self) -> DiffSource
fn clone(&self) -> DiffSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DiffSource
Source§impl Debug for DiffSource
impl Debug for DiffSource
impl Eq for DiffSource
Source§impl PartialEq for DiffSource
impl PartialEq for DiffSource
impl StructuralPartialEq for DiffSource
Auto Trait Implementations§
impl Freeze for DiffSource
impl RefUnwindSafe for DiffSource
impl Send for DiffSource
impl Sync for DiffSource
impl Unpin for DiffSource
impl UnsafeUnpin for DiffSource
impl UnwindSafe for DiffSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more