squash: add -f/-t shorthands for --from/--[in]to

move already supports these, so this improves squash's parity (I believe
squash is strictly a superset now) as we inch towards deleting move.

Change-Id: Id00000005f2a7f551cb7a0aa598c6265091a32d1
This commit is contained in:
Vamsi Avula 2024-10-09 16:15:10 +05:30
parent a9433784b0
commit 93a4fcfe32
3 changed files with 6 additions and 4 deletions

View file

@ -30,6 +30,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
* New `at_operation(op, expr)` revset can be used in order to query revisions
based on historical state.
* `jj squash` now supports `-f/-t` shorthands for `--from/--[in]to`.
### Fixed bugs
* Error on `trunk()` revset resolution is now handled gracefully.

View file

@ -60,10 +60,10 @@ pub(crate) struct SquashArgs {
#[arg(long, short)]
revision: Option<RevisionArg>,
/// Revision(s) to squash from (default: @)
#[arg(long, conflicts_with = "revision")]
#[arg(long, short, conflicts_with = "revision")]
from: Vec<RevisionArg>,
/// Revision to squash into (default: @)
#[arg(long, conflicts_with = "revision", visible_alias = "to")]
#[arg(long, short = 't', conflicts_with = "revision", visible_alias = "to")]
into: Option<RevisionArg>,
/// The description to use for squashed revision (don't open editor)
#[arg(long = "message", short, value_name = "MESSAGE")]

View file

@ -1986,8 +1986,8 @@ If a working-copy commit gets abandoned, it will be given a new, empty commit. T
###### **Options:**
* `-r`, `--revision <REVISION>` — Revision to squash into its parent (default: @)
* `--from <FROM>` — Revision(s) to squash from (default: @)
* `--into <INTO>` — Revision to squash into (default: @)
* `-f`, `--from <FROM>` — Revision(s) to squash from (default: @)
* `-t`, `--into <INTO>` — Revision to squash into (default: @)
* `-m`, `--message <MESSAGE>` — The description to use for squashed revision (don't open editor)
* `-u`, `--use-destination-message` — Use the description of the destination revision and discard the description(s) of the source revision(s)
* `-i`, `--interactive` — Interactively choose which parts to squash