diff --git a/CHANGELOG.md b/CHANGELOG.md index 44a3003a2..3e7f362ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Breaking changes + +* `jj [op] undo` and `jj op restore` used to take the operation to undo or + restore to as an argument to `-o/--operation`. It is now a positional + argument instead (i.e. `jj undo -o abc123` is now written `jj undo abc123`). + ### New features * `jj rebase` now accepts a `--branch/-b ` argument, which can be used diff --git a/src/commands.rs b/src/commands.rs index 2e4c14d35..8e27d53ac 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1527,7 +1527,7 @@ struct OperationLogArgs {} #[derive(clap::Args, Clone, Debug)] struct OperationRestoreArgs { /// The operation to restore to - #[clap(long, alias = "op", short, default_value = "@")] + #[clap(default_value = "@")] operation: String, } @@ -1535,7 +1535,7 @@ struct OperationRestoreArgs { #[derive(clap::Args, Clone, Debug)] struct OperationUndoArgs { /// The operation to undo - #[clap(long, alias = "op", short, default_value = "@")] + #[clap(default_value = "@")] operation: String, } diff --git a/tests/test_undo.rs b/tests/test_undo.rs index e76a051e3..aa465a5ec 100644 --- a/tests/test_undo.rs +++ b/tests/test_undo.rs @@ -35,7 +35,7 @@ fn test_undo_rewrite_with_child() { o modified o "###); - test_env.jj_cmd_success(&repo_path, &["undo", "-o", &op_id_hex]); + test_env.jj_cmd_success(&repo_path, &["undo", &op_id_hex]); // Since we undid the description-change, the child commit should now be on top // of the initial commit