Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,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 @@ -1972,8 +1972,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