diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e0c5574d..0401b8734 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Replacing `-l` shorthand for `--limit` with `-n` in `jj log`, `jj op log` and `jj obslog`. +* `jj split --siblings` is deprecated in favor of `jj split --parallel` (to + match `jj parallelize`). + ### New features * Show paths to config files when configuration errors occur diff --git a/cli/src/commands/split.rs b/cli/src/commands/split.rs index ef4faa2af..f0d2b2793 100644 --- a/cli/src/commands/split.rs +++ b/cli/src/commands/split.rs @@ -51,9 +51,11 @@ pub(crate) struct SplitArgs { /// The revision to split #[arg(long, short, default_value = "@")] revision: RevisionArg, - /// Split the revision into two siblings instead of a parent and child. - #[arg(long, short)] - siblings: bool, + /// Split the revision into two parallel revisions instead of a parent and + /// child. + // TODO: Delete `--siblings` alias in jj 0.25+ + #[arg(long, short, alias = "siblings")] + parallel: bool, /// Put these paths in the first commit #[arg(value_hint = clap::ValueHint::AnyPath)] paths: Vec, @@ -137,7 +139,7 @@ the operation will be aborted. // Create the second commit, which includes everything the user didn't // select. - let (second_tree, second_base_tree) = if args.siblings { + let (second_tree, second_base_tree) = if args.parallel { // Merge the original commit tree with its parent using the tree // containing the user selected changes as the base for the merge. // This results in a tree with the changes the user didn't select. @@ -145,7 +147,7 @@ the operation will be aborted. } else { (end_tree, &selected_tree) }; - let second_commit_parents = if args.siblings { + let second_commit_parents = if args.parallel { commit.parent_ids().to_vec() } else { vec![first_commit.id().clone()] @@ -189,11 +191,11 @@ the operation will be aborted. vec![commit.id().clone()], |mut rewriter| { num_rebased += 1; - if args.siblings { + if args.parallel { rewriter .replace_parent(second_commit.id(), [first_commit.id(), second_commit.id()]); } - // We don't need to do anything special for the non-siblings case + // We don't need to do anything special for the non-parallel case // since we already marked the original commit as rewritten. rewriter.rebase(command.settings())?.write()?; Ok(()) diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index 2ea06e945..60cb7e0f4 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -1771,7 +1771,7 @@ Splitting an empty commit is not supported because the same effect can be achiev * `-r`, `--revision ` — The revision to split Default value: `@` -* `-s`, `--siblings` — Split the revision into two siblings instead of a parent and child +* `-p`, `--parallel` — Split the revision into two parallel revisions instead of a parent and child Possible values: `true`, `false` diff --git a/cli/tests/test_split_command.rs b/cli/tests/test_split_command.rs index 36768099b..2b3666b1d 100644 --- a/cli/tests/test_split_command.rs +++ b/cli/tests/test_split_command.rs @@ -343,7 +343,7 @@ fn test_split_siblings_no_descendants() { ["dump editor1", "next invocation\n", "dump editor2"].join("\0"), ) .unwrap(); - let (stdout, stderr) = test_env.jj_cmd_ok(&workspace_path, &["split", "--siblings", "file1"]); + let (stdout, stderr) = test_env.jj_cmd_ok(&workspace_path, &["split", "--parallel", "file1"]); insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stderr, @r###" First part: qpvuntsm 8d2b7558 TESTED=TODO @@ -421,7 +421,7 @@ fn test_split_siblings_with_descendants() { .join("\0"), ) .unwrap(); - let (stdout, stderr) = test_env.jj_cmd_ok(&workspace_path, &["split", "--siblings", "file1"]); + let (stdout, stderr) = test_env.jj_cmd_ok(&workspace_path, &["split", "--parallel", "file1"]); insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stderr, @r###" Rebased 2 descendant commits @@ -500,7 +500,7 @@ fn test_split_siblings_with_merge_child() { .unwrap(); let (stdout, stderr) = test_env.jj_cmd_ok( &workspace_path, - &["split", "-r", "description(a)", "--siblings", "file1"], + &["split", "-r", "description(a)", "--parallel", "file1"], ); insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stderr, @r###"