Skip to content

Commit

Permalink
squash: add -f/-t shorthands for --from/--[in]to
Browse files Browse the repository at this point in the history
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
  • Loading branch information
avamsi committed Oct 13, 2024
1 parent a943378 commit 93a4fcf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions cli/src/commands/squash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
4 changes: 2 additions & 2 deletions cli/tests/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 93a4fcf

Please sign in to comment.