From 939ba53d0fa704b58c64b933a390430ce89e0ca0 Mon Sep 17 00:00:00 2001 From: Vamsi Avula Date: Wed, 9 Oct 2024 16:15:10 +0530 Subject: [PATCH] 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 --- CHANGELOG.md | 2 ++ cli/src/commands/squash.rs | 4 ++-- cli/tests/cli-reference@.md.snap | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b6abbd72f..5c501724b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). * New command `jj simplify-parents` will remove redundant parent edges. +* `jj squash` now supports `-f/-t` shorthands for `--from/--[in]to`. + ### Fixed bugs diff --git a/cli/src/commands/squash.rs b/cli/src/commands/squash.rs index 8d54a62fa4..f412e4bd70 100644 --- a/cli/src/commands/squash.rs +++ b/cli/src/commands/squash.rs @@ -60,10 +60,10 @@ pub(crate) struct SquashArgs { #[arg(long, short)] revision: Option, /// Revision(s) to squash from (default: @) - #[arg(long, conflicts_with = "revision")] + #[arg(long, short, conflicts_with = "revision")] from: Vec, /// 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, /// The description to use for squashed revision (don't open editor) #[arg(long = "message", short, value_name = "MESSAGE")] diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index 7cc659c793..a6a9981adc 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -1972,8 +1972,8 @@ If a working-copy commit gets abandoned, it will be given a new, empty commit. T ###### **Options:** * `-r`, `--revision ` — Revision to squash into its parent (default: @) -* `--from ` — Revision(s) to squash from (default: @) -* `--into ` — Revision to squash into (default: @) +* `-f`, `--from ` — Revision(s) to squash from (default: @) +* `-t`, `--into ` — Revision to squash into (default: @) * `-m`, `--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