Skip to content

Commit

Permalink
cli: allow (and ignore) -d flag for jj new
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
martinvonz committed Oct 15, 2024
1 parent 470275b commit f4c0baf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cli/src/commands/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ pub(crate) struct NewArgs {
/// Parent(s) of the new change
#[arg(default_value = "@")]
pub(crate) revisions: Vec<RevisionArg>,
/// 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<String>,
Expand Down

0 comments on commit f4c0baf

Please sign in to comment.