ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: require at least one destination for rebase

Rebasing onto no commits (i.e. onto the root commit) is almost
definitely not what you meant to do if you run `jj rebase` (without
any arguments).
This commit is contained in:
Martin von Zweigbergk 2022-04-11 10:40:56 -07:00 committed by Martin von Zweigbergk
parent 97a1a3e20b
commit 677dea1682
2 changed files with 4 additions and 1 deletions

View file

@ -37,6 +37,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `jj untrack` now requires at least one path (allowing no arguments was a UX
bug).
* `jj rebase` now requires at least one destination (allowing no arguments was a
UX bug).
* You now get a proper error message instead of a crash when `$EDITOR` doesn't
exist or exits with an error.

View file

@ -1422,7 +1422,7 @@ struct RebaseArgs {
#[clap(long, short)]
source: Option<String>,
/// The revision to rebase onto
#[clap(long, short)]
#[clap(long, short, required = true, min_values = 1)]
destination: Vec<String>,
}