From f4c0baf7124464cf79792e8e05af5e5bf471c88c Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Mon, 14 Oct 2024 21:12:52 -0700 Subject: [PATCH] cli: allow (and ignore) `-d` flag for `jj new` We were discussing whether `jj backout` and `jj duplicate` should support `-d/-A/-B` just like `jj rebase` does. `jj new` already accepts `-A/-B` but it does not accept `-d`. It does support `-r`, however. It seems like `-d` is a better match for `jj new` since it creates a commit on top. So this patch adds support for that flag too. I now think `-r` sounds misleading for `jj new`, but I left it in for now. --- cli/src/commands/new.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/src/commands/new.rs b/cli/src/commands/new.rs index 70a30cab72..09ea51a7a0 100644 --- a/cli/src/commands/new.rs +++ b/cli/src/commands/new.rs @@ -51,9 +51,10 @@ pub(crate) struct NewArgs { /// Parent(s) of the new change #[arg(default_value = "@")] pub(crate) revisions: Vec, - /// Ignored (but lets you pass `-r` for consistency with other commands) - #[arg(short = 'r', hide = true, action = clap::ArgAction::Count)] - unused_revision: u8, + /// Ignored (but lets you pass `-d`/`-r` for consistency with other + /// commands) + #[arg(short = 'd', hide = true, short_alias = 'r', action = clap::ArgAction::Count)] + unused_destination: u8, /// The change description to use #[arg(long = "message", short, value_name = "MESSAGE")] message_paragraphs: Vec,