pub enum MergeStyle {
Merge,
Squash,
Rebase,
}Expand description
How the winning branch is attached to the base branch: what
mode = "local" runs, and what mode = "none"’s printed guidance tells
the operator to run by hand.
Read from configuration rather than asked of the repository at run time
(e.g. gh api repos/{owner}/{repo}/rulesets) for two reasons: it keeps
mode = "none"’s guidance a pure function of RunState, assertable in a
unit test the same way land::decide is kept pure (see that module’s
doc), and it works for a base branch that is not hosted on GitHub, or not
reachable at all, at the moment the report is rendered. An operator whose
base branch enforces a ruleset already knows what it allows; declaring it
once here is cheaper than magi re-discovering it, with a network call, on
every render.
Variants§
Merge
git merge --no-ff: every candidate commit lands, plus a merge
commit that records the merge as its own event in history. Rejected
by a base branch whose ruleset requires linear history or forbids
merge commits outright.
Squash
git merge --squash followed by a commit under an explicit message:
every candidate commit folds into one, and none of the candidate’s
own placeholder subjects (magi: candidate A (uncommitted work))
reach the base branch. No merge commit, so this satisfies a linear-
history ruleset.
Rebase
A fast-forward-only merge: every candidate commit lands verbatim, in
order, with no merge commit. Only succeeds because the winner was
already rebased onto the tracked base tip before this runs (see
Runner::sync_to_base) — equivalent to GitHub’s “rebase and merge”
once that has happened.
Trait Implementations§
Source§impl Clone for MergeStyle
impl Clone for MergeStyle
Source§fn clone(&self) -> MergeStyle
fn clone(&self) -> MergeStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MergeStyle
Source§impl Debug for MergeStyle
impl Debug for MergeStyle
Source§impl Default for MergeStyle
impl Default for MergeStyle
Source§fn default() -> MergeStyle
fn default() -> MergeStyle
Source§impl<'de> Deserialize<'de> for MergeStyle
impl<'de> Deserialize<'de> for MergeStyle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for MergeStyle
Source§impl PartialEq for MergeStyle
impl PartialEq for MergeStyle
Source§impl Serialize for MergeStyle
impl Serialize for MergeStyle
impl StructuralPartialEq for MergeStyle
Auto Trait Implementations§
impl Freeze for MergeStyle
impl RefUnwindSafe for MergeStyle
impl Send for MergeStyle
impl Sync for MergeStyle
impl Unpin for MergeStyle
impl UnsafeUnpin for MergeStyle
impl UnwindSafe for MergeStyle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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> ⓘ
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> ⓘ
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