Skip to content

Commit

Permalink
commands: add --interactive flag to jj split
Browse files Browse the repository at this point in the history
I am constantly explicitly running `jj split -i` because I expect the interactive flag to be there for consistency.
  • Loading branch information
arxanas committed Aug 27, 2023
1 parent 40f849a commit 77972af
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,14 @@ struct DiffeditArgs {
/// asked for a description only for the first part.
#[derive(clap::Args, Clone, Debug)]
struct SplitArgs {
/// Interactively choose which parts to split. This is the default if no
/// paths are provided.
#[arg(long, short)]
interactive: bool,
/// The revision to split
#[arg(long, short, default_value = "@")]
revision: RevisionArg,
/// Put these paths in the first commit and don't run the diff editor
/// Put these paths in the first commit
#[arg(value_hint = clap::ValueHint::AnyPath)]
paths: Vec<String>,
}
Expand Down Expand Up @@ -3067,7 +3071,7 @@ fn cmd_split(ui: &mut Ui, command: &CommandHelper, args: &SplitArgs) -> Result<(
let mut tx =
workspace_command.start_transaction(&format!("split commit {}", commit.id().hex()));
let base_tree = merge_commit_trees(tx.repo(), &commit.parents())?;
let interactive = args.paths.is_empty();
let interactive = args.interactive || args.paths.is_empty();
let instructions = format!(
"\
You are splitting a commit in two: {}
Expand Down

0 comments on commit 77972af

Please sign in to comment.