pub enum NextAction {
Show 13 variants
StartNewWork,
SyncHomeWithUpstream {
behind_count: usize,
},
CommitChanges,
PushChanges,
CreatePr {
base: Option<String>,
},
WaitingForReview {
pr_number: u64,
},
Cleanup,
BehindBase {
base: String,
behind_count: usize,
},
PullUpstream {
behind_count: usize,
},
ResolveDivergence,
PrClosed {
pr_number: u64,
},
SyncNeeded {
base_branch: String,
},
StackedBaseMerged {
base_branch: String,
base_sha: Option<String>,
},
}Expand description
Recommended next action based on current state
Variants§
StartNewWork
On home branch, ready to start new work
SyncHomeWithUpstream
On home branch but behind upstream, should sync first
CommitChanges
Has uncommitted changes, should commit
PushChanges
Has unpushed commits, should push
CreatePr
Pushed but no PR, should create PR. base is the stacked parent branch
to pass as -B, or None when the PR targets the default branch.
WaitingForReview
PR is open, waiting for review/CI
Cleanup
PR is merged, should cleanup
BehindBase
The base this branch sits on (origin/main, or the stacked parent)
has new commits; catch up with gw sync before publishing.
PullUpstream
Someone pushed to this branch’s upstream; pull those commits first.
ResolveDivergence
Branch has diverged from upstream, needs resolution
PrClosed
PR was closed without merging
SyncNeeded
Base PR was merged, should sync (update base to main, rebase, push)
StackedBaseMerged
Recorded stacked base merged before this branch’s PR was created; rebase
onto the default branch and open a normal (non-stacked) PR. base_sha is
the recorded base tip used as the --onto boundary when present (it
survives the base branch being deleted).
Implementations§
Source§impl NextAction
impl NextAction
Sourcepub fn detect(ctx: &DetectContext<'_>) -> Self
pub fn detect(ctx: &DetectContext<'_>) -> Self
Detect the next action based on current state. See DetectContext.
Sourcepub fn short_description(&self) -> &'static str
pub fn short_description(&self) -> &'static str
Get a short description for the action
Trait Implementations§
Source§impl Clone for NextAction
impl Clone for NextAction
Source§fn clone(&self) -> NextAction
fn clone(&self) -> NextAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more