Skip to main content

RemoteOp

Struct RemoteOp 

Source
pub struct RemoteOp {
    pub what: &'static str,
    pub doing: &'static str,
    pub args: &'static [&'static str],
    pub flags: &'static [RemoteFlag],
}

Fields§

§what: &'static str

NC.4: what this does, as an imperative phrase a user reads (“continue rebase”, not “rebase –continue”). The notification label is built from it — see Self::label — and must read correctly before “failed” as well as before a summary.

§doing: &'static str

The same, in progress, for the fire-time echo (“continuing rebase…”). Spelled out rather than derived: appending “ing” to what produced “stage alling” and “cherry-pick –continueing”.

§args: &'static [&'static str]

Base argv passed to git, before flags.

§flags: &'static [RemoteFlag]

Toggleable flags, in args_schema order.

Implementations§

Source§

impl RemoteOp

Source

pub const PULL: Self

Source

pub const PUSH: Self

Source

pub const FETCH: Self

Source

pub const CHERRY_PICK_CONTINUE: Self

MG.34: the way out of a rebase that stopped.

magit-edit-line-commit marks a commit edit, which is only useful if the rebase can be resumed afterwards — and until this slice the ONLY sequencer control was C-c C-k inside a todo buffer, so a stopped rebase left the repository in a state the editor could not finish. Shipping the edit row without these would have been shipping a trap.

GIT_EDITOR is forced to true by [run_remote_op] for the same reason run_rebase does it: --continue opens the commit message in $EDITOR, and an editor we cannot drive would hang the task forever.

Source

pub const CHERRY_PICK_SKIP: Self

Source

pub const CHERRY_PICK_ABORT: Self

Source

pub const REVERT_CONTINUE: Self

Source

pub const REVERT_SKIP: Self

Source

pub const REVERT_ABORT: Self

Source

pub const MERGE_CONTINUE: Self

Conclude a merge stopped on a conflict. Equivalent to committing the prepared merge message once the index is clean; git refuses it while unmerged paths remain, which is the right answer and is reported rather than swallowed.

Source

pub const MERGE_ABORT: Self

Throw the merge away and restore the branch.

Source

pub const REBASE_CONTINUE: Self

Source

pub const REBASE_SKIP: Self

Source

pub const REBASE_ABORT: Self

The abort C-c C-k runs, reachable when there is no todo buffer open — which is the case once the rebase has actually started.

Source

pub const NOTES_PRUNE: Self

MG.37: the notes operations with no argument. spawn_remote_op’s shape — one bounded argv, off-thread, notify — fits them for the same reason it fits the rebase sequencer.

Source

pub const NOTES_MERGE_COMMIT: Self

Source

pub const NOTES_MERGE_ABORT: Self

Source

pub const AM_CONTINUE: Self

MG.39: the way out of a git am that stopped.

am stops on a patch that does not apply, exactly as rebase stops on edit — and for the same reason as MG.34’s sequencer commands, shipping the apply without these would leave the repository in a state the editor cannot finish.

Source

pub const AM_SKIP: Self

Source

pub const AM_ABORT: Self

Source

pub const STAGE_ALL: Self

MG.23b: magit’s S — stage every tracked modification at once.

add --update, matching magit-stage-modified: tracked changes only. Untracked files are deliberately NOT swept in — “stage everything” quietly adding a file you never told git about is how build artefacts and secrets get committed. Magit reaches that behaviour behind a prefix argument, which is exactly the deferred <C-u> work; until then s on the Untracked entry in magit-status is the explicit path.

Source

pub const UNSTAGE_ALL: Self

MG.23b: magit’s U — unstage everything.

A bare git reset: the index goes back to HEAD and the working tree is untouched, so nothing is lost and every change is still there to re-stage. That is why it does not ask, per §12.13’s no-confirm set for index-only work — the blast radius is wider than one file but it is still fully reversible.

Source

pub const STASH_KEEP_INDEX: Self

MG.41d: magit’s x — stash everything but leave the index staged, so a partially-staged commit can be tried in isolation.

Source

pub const STASH_STAGED: Self

MG.41d: magit’s i — stash only what is staged.

Source

pub const STASH: Self

Source

pub fn argv(&self, args: &Args) -> Vec<String>

Resolve the full argv for this run: the base plus every flag the caller enabled. args is positional by flags order — see RemoteOp::flags.

Source

pub fn label(&self, argv: &[String]) -> String

NC.4: the notification label for one run, naming what the resolved argv acts on.

Built from the argv rather than the transient state, so it describes what actually ran — including a destination resolved at run time. A force-push, a dry run and a push of tags each read differently from a plain push; before this they all read “push”.

Source

pub fn preview(&self, value_of: &dyn Fn(&str) -> Option<String>) -> String

The command line this run would execute, for the transient’s live preview. Renders what argv will actually pass, so the preview cannot claim one thing and the run do another.

Source

pub fn arg_specs(&self) -> Vec<ArgSpec>

args_schema for this operation’s ex-command — one optional bool per flag, in slice order.

Trait Implementations§

Source§

impl Clone for RemoteOp

Source§

fn clone(&self) -> RemoteOp

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 Copy for RemoteOp

Source§

impl Debug for RemoteOp

Source§

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

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

impl Eq for RemoteOp

Source§

impl PartialEq for RemoteOp

Source§

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

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
§

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

§

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

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

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

§

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.

§

impl<T> Instrument for T

§

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

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

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

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = 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.
§

impl<T> WithSubscriber for T

§

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
§

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

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