From ff0188d63ac495b61feb27bb938d80e8193e298f Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Mon, 15 Jul 2024 11:57:36 -0700 Subject: [PATCH] cli `branch create/set`: add `--to` aliases for `-r` Now that `jj move` does not accept `-r` (since it has `--from` and `--to`), `jj set --to` seems more useful than `jj set -r`. `create --to` is also added for ease of switching between `branch create` and `branch move`. --- cli/src/commands/branch/create.rs | 5 ++++- cli/src/commands/branch/set.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/src/commands/branch/create.rs b/cli/src/commands/branch/create.rs index b23cb666d..0f6964d81 100644 --- a/cli/src/commands/branch/create.rs +++ b/cli/src/commands/branch/create.rs @@ -25,7 +25,10 @@ use crate::ui::Ui; #[derive(clap::Args, Clone, Debug)] pub struct BranchCreateArgs { /// The branch's target revision - #[arg(long, short)] + // + // The `--to` alias exists for making it easier for the user to switch + // between `branch create`, `branch move`, and `branch set`. + #[arg(long, short, visible_alias = "to")] revision: Option, /// The branches to create diff --git a/cli/src/commands/branch/set.rs b/cli/src/commands/branch/set.rs index 2530df96d..c7cc087ba 100644 --- a/cli/src/commands/branch/set.rs +++ b/cli/src/commands/branch/set.rs @@ -25,7 +25,7 @@ use crate::ui::Ui; #[derive(clap::Args, Clone, Debug)] pub struct BranchSetArgs { /// The branch's target revision - #[arg(long, short)] + #[arg(long, short, visible_alias = "to")] revision: Option, /// Allow moving the branch backwards or sideways