Skip to content

Commit

Permalink
squash: accept -k as a shorthand for --keep-emptied
Browse files Browse the repository at this point in the history
This eases the workflow in which a commit in the middle of the tree is
repeatedly squashed into its parent.
  • Loading branch information
samueltardieu committed Sep 15, 2024
1 parent 7ff12ec commit a7f32d3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

* `jj op undo` now reports information on the operation that has been undone.

* `jj squash`: the `-k` flag can be used as a shorthand for `--keep-emptied`.

### Fixed bugs

* Fixed panic when parsing invalid conflict markers of a particular form.
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/squash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub(crate) struct SquashArgs {
#[arg(conflicts_with_all = ["interactive", "tool"], value_hint = clap::ValueHint::AnyPath)]
paths: Vec<String>,
/// The source revision will not be abandoned
#[arg(long)]
#[arg(long, short)]
keep_emptied: bool,
}

Expand Down
2 changes: 1 addition & 1 deletion cli/tests/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,7 @@ If a working-copy commit gets abandoned, it will be given a new, empty commit. T
* `-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
* `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
* `--keep-emptied` — The source revision will not be abandoned
* `-k`, `--keep-emptied` — The source revision will not be abandoned
Expand Down

0 comments on commit a7f32d3

Please sign in to comment.