From 677dea16825fa1ad1774296b89e5957fe46d5e32 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Mon, 11 Apr 2022 10:40:56 -0700 Subject: [PATCH] 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). --- CHANGELOG.md | 3 +++ src/commands.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 014c045c7..98757cdc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/commands.rs b/src/commands.rs index 4a04a2499..083214b59 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1422,7 +1422,7 @@ struct RebaseArgs { #[clap(long, short)] source: Option, /// The revision to rebase onto - #[clap(long, short)] + #[clap(long, short, required = true, min_values = 1)] destination: Vec, }