pub enum NextAction {
StartNewWork,
SyncHomeWithUpstream {
behind_count: usize,
},
CommitChanges,
PushChanges,
CreatePr,
WaitingForReview {
pr_number: u64,
},
Cleanup,
RebaseNeeded,
ResolveDivergence,
PrClosed {
pr_number: u64,
},
SyncNeeded {
base_branch: 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
WaitingForReview
PR is open, waiting for review/CI
Cleanup
PR is merged, should cleanup
RebaseNeeded
Branch is behind origin/main, should rebase
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)
Implementations§
Source§impl NextAction
impl NextAction
Sourcepub fn detect(
current_branch: &str,
home_branch: &str,
working_dir: &WorkingDirState,
sync_state: &SyncState,
pr_info: Option<&PrInfo>,
has_remote: bool,
base_pr_merged: Option<&str>,
) -> Self
pub fn detect( current_branch: &str, home_branch: &str, working_dir: &WorkingDirState, sync_state: &SyncState, pr_info: Option<&PrInfo>, has_remote: bool, base_pr_merged: Option<&str>, ) -> Self
Detect the next action based on current state
§Arguments
base_pr_merged- If Some(branch_name), the base PR for that branch was merged
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NextAction
impl Debug for NextAction
Source§impl PartialEq for NextAction
impl PartialEq for NextAction
impl Eq for NextAction
impl StructuralPartialEq for NextAction
Auto Trait Implementations§
impl Freeze for NextAction
impl RefUnwindSafe for NextAction
impl Send for NextAction
impl Sync for NextAction
impl Unpin for NextAction
impl UnwindSafe for NextAction
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