pub struct CommitWorkflow<J: JjExecutor, P: Prompter = RealPrompts> { /* private fields */ }Expand description
Orchestrates the interactive commit workflow
This struct handles the complete user interaction flow:
- Check if we’re in a jj repository
- Select commit type from 11 options
- Optionally input scope (validated)
- Input required description (validated)
- Preview formatted message and confirm
- Apply the message to the current change
Uses dependency injection for prompts to enable testing without TUI.
Implementations§
Source§impl<J: JjExecutor> CommitWorkflow<J>
impl<J: JjExecutor> CommitWorkflow<J>
Source§impl<J: JjExecutor, P: Prompter> CommitWorkflow<J, P>
impl<J: JjExecutor, P: Prompter> CommitWorkflow<J, P>
Sourcepub fn with_prompts(executor: J, prompts: P) -> Self
pub fn with_prompts(executor: J, prompts: P) -> Self
Create a new CommitWorkflow with custom prompts
This allows using MockPrompts in tests to avoid TUI hanging.
Sourcepub async fn run_for_revset(&self, revset: &str) -> Result<(), Error>
pub async fn run_for_revset(&self, revset: &str) -> Result<(), Error>
Run the complete interactive workflow
Returns Ok(()) on successful completion, or an error if:
- Not in a jj repository
- User cancels the workflow
- Repository operation fails
- Message validation fails
pub async fn new_revision(&self, revset: &str) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl<J, P> Freeze for CommitWorkflow<J, P>
impl<J, P> RefUnwindSafe for CommitWorkflow<J, P>where
J: RefUnwindSafe,
P: RefUnwindSafe,
impl<J, P> Send for CommitWorkflow<J, P>where
P: Send,
impl<J, P> Sync for CommitWorkflow<J, P>where
P: Sync,
impl<J, P> Unpin for CommitWorkflow<J, P>
impl<J, P> UnsafeUnpin for CommitWorkflow<J, P>where
J: UnsafeUnpin,
P: UnsafeUnpin,
impl<J, P> UnwindSafe for CommitWorkflow<J, P>where
J: UnwindSafe,
P: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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 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>
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