Enum branchless::core::rewrite::RebaseCommand
source · pub enum RebaseCommand {
CreateLabel {
label_name: String,
},
Reset {
target: OidOrLabel,
},
Pick {
original_commit_oid: NonZeroOid,
commit_to_apply_oid: NonZeroOid,
},
Merge {
commit_oid: NonZeroOid,
commits_to_merge: Vec<OidOrLabel>,
},
Replace {
commit_oid: NonZeroOid,
replacement_commit_oid: NonZeroOid,
parents: Vec<OidOrLabel>,
},
Break,
RegisterExtraPostRewriteHook,
DetectEmptyCommit {
commit_oid: NonZeroOid,
},
SkipUpstreamAppliedCommit {
commit_oid: NonZeroOid,
},
}
Expand description
A command that can be applied for either in-memory or on-disk rebases.
Variants§
CreateLabel
Create a label (a reference stored in refs/rewritten/
) pointing to the
current rebase head for later use.
Reset
Fields
target: OidOrLabel
The target to check out.
Move the rebase head to the provided label or commit.
Pick
Fields
original_commit_oid: NonZeroOid
The original commit, which contains the relevant metadata such as the commit message.
commit_to_apply_oid: NonZeroOid
The commit whose patch should be applied to the rebase head. This
will be different from [original_commit_oid
] when a commit is
being replaced.
Apply the provided commit on top of the rebase head, and update the rebase head to point to the newly-applied commit.
Merge
Fields
commit_oid: NonZeroOid
The original merge commit to copy the commit contents from.
commits_to_merge: Vec<OidOrLabel>
The other commits to merge into this one. This may be a list of
either OIDs or strings. This will always be one fewer commit than
the number of actual parents for this commit, since we always merge
into the current HEAD
commit when rebasing.
Merge two or more parent commits.
Replace
Fields
commit_oid: NonZeroOid
The commit to be replaced. It should be part of another rebase command, or else we will never encounter it for replacement.
replacement_commit_oid: NonZeroOid
The replacement commit whose metadata and tree we’ll use.
parents: Vec<OidOrLabel>
The new parents for the replaced commit.
When rebasing commit_oid
, apply it by replacing its commit metadata
and tree with that of replacement_commit_oid
, and by replacing its
parents with parents
. No patches will be computed or applied, so this
operation is guaranteed to never cause a merge conflict.
Break
Pause the rebase, to be resumed later. Only supported in on-disk rebases.
RegisterExtraPostRewriteHook
On-disk rebases only. Register that we want to run cleanup at the end of
the rebase, during the post-rewrite
hook.
DetectEmptyCommit
Fields
commit_oid: NonZeroOid
The original commit. If the new commit is empty, then the original commit will be recorded as skipped.
Determine if the current commit is empty. If so, reset the rebase head
to its parent and record that it was empty in the rewritten-list
.
SkipUpstreamAppliedCommit
Fields
commit_oid: NonZeroOid
The original commit, which will be recorded as skipped.
The commit that would have been applied to the rebase head was already
applied upstream. Skip it and record it in the rewritten-list
.
Trait Implementations§
source§impl Debug for RebaseCommand
impl Debug for RebaseCommand
Auto Trait Implementations§
impl RefUnwindSafe for RebaseCommand
impl Send for RebaseCommand
impl Sync for RebaseCommand
impl Unpin for RebaseCommand
impl UnwindSafe for RebaseCommand
Blanket Implementations§
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>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more