Skip to content

Commit

Permalink
unsquash: deprecated in favor of squash
Browse files Browse the repository at this point in the history
Everything can be done with `jj squash` that could be done with `jj
unsquash`.
  • Loading branch information
samueltardieu committed Sep 15, 2024
1 parent 56dbbb8 commit 7624dd1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 29 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
that describes them better, and they also behave similar to Mercurial's
bookmarks.

* `jj unsquash` has been deprecated in favor of `jj squash`.

**Rationale:** `jj squash` can do everything `jj unsquash` does, and more.
For example, `jj squash` can select the paths to be pulled from the source
commit to the target commit. To do this with `jj unsquash` requires the use
of the interactive mode.

* The `git.push-branch-prefix` config has been deprecated in favor of
`git.push-bookmark-prefix`.

Expand Down
1 change: 1 addition & 0 deletions cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ enum Command {
Util(util::UtilCommand),
/// Undo an operation (shortcut for `jj op undo`)
Undo(operation::undo::OperationUndoArgs),
#[command(hide = true)]
Unsquash(unsquash::UnsquashArgs),
// TODO: Delete `untrack` in jj 0.27+
#[command(hide = true)]
Expand Down
3 changes: 2 additions & 1 deletion cli/src/commands/unsquash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ use crate::command_error::CommandError;
use crate::description_util::combine_messages;
use crate::ui::Ui;

/// Move changes from a revision's parent into the revision
/// Move changes from a revision's parent into the revision (DEPRECATED, use `jj
/// squash`)
///
/// After moving the changes out of the parent, the child revision will have the
/// same content state as before. If moving the change out of the parent change
Expand Down
24 changes: 0 additions & 24 deletions cli/tests/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ This document contains the help content for the `jj` command-line program.
* [`jj util markdown-help`↴](#jj-util-markdown-help)
* [`jj util config-schema`↴](#jj-util-config-schema)
* [`jj undo`↴](#jj-undo)
* [`jj unsquash`↴](#jj-unsquash)
* [`jj version`↴](#jj-version)
* [`jj workspace`↴](#jj-workspace)
* [`jj workspace add`↴](#jj-workspace-add)
Expand Down Expand Up @@ -145,7 +144,6 @@ To get started, see the tutorial at https://martinvonz.github.io/jj/latest/tutor
* `tag`Manage tags
* `util`Infrequently used commands such as for generating shell completions
* `undo`Undo an operation (shortcut for `jj op undo`)
* `unsquash`Move changes from a revision's parent into the revision
* `version`Display version information
* `workspace`Commands for working with workspaces

Expand Down Expand Up @@ -2097,28 +2095,6 @@ Undo an operation (shortcut for `jj op undo`)
## `jj unsquash`
Move changes from a revision's parent into the revision
After moving the changes out of the parent, the child revision will have the same content state as before. If moving the change out of the parent change made it empty compared to its parent, it will be abandoned. Without `--interactive`, the parent change will always become empty.
If the source became empty and both the source and destination had a non-empty description, you will be asked for the combined description. If either was empty, then the other one will be used.
If a working-copy commit gets abandoned, it will be given a new, empty commit. This is true in general; it is not specific to this command.
**Usage:** `jj unsquash [OPTIONS]`
###### **Options:**
* `-r`, `--revision <REVISION>`
Default value: `@`
* `-i`, `--interactive` — Interactively choose which parts to unsquash
* `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
## `jj version`
Display version information
Expand Down
7 changes: 3 additions & 4 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,6 @@ line. Unlike `jj squash -i`, which left the content state of the commit
unchanged, `jj diffedit` (typically) results in a different state, which means
that descendant commits may have conflicts.
Other commands for rewriting contents of existing commits are `jj split`, `jj
unsquash -i`. Now that you've seen how `jj squash -i` and `jj diffedit` work,
you can hopefully figure out how those work (with the help of the instructions
in the diff).
Another command for rewriting contents of existing commits is `jj split`. Now that
you've seen how `jj squash -i` and `jj diffedit` work, you can hopefully figure out
how it works (with the help of the instructions in the diff).

0 comments on commit 7624dd1

Please sign in to comment.