diff --git a/CHANGELOG.md b/CHANGELOG.md index 50ef5f51c4d..f49f495f49b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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`. diff --git a/cli/src/commands/mod.rs b/cli/src/commands/mod.rs index 52c03c17437..9da5b53a5f1 100644 --- a/cli/src/commands/mod.rs +++ b/cli/src/commands/mod.rs @@ -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)] diff --git a/cli/src/commands/unsquash.rs b/cli/src/commands/unsquash.rs index eb11a7a073d..dd0c635b6c7 100644 --- a/cli/src/commands/unsquash.rs +++ b/cli/src/commands/unsquash.rs @@ -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 diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index e8c52c65257..8e0fc35acd8 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -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) @@ -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 @@ -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 ` - - Default value: `@` -* `-i`, `--interactive` — Interactively choose which parts to unsquash -* `--tool ` — Specify diff editor to be used (implies --interactive) - - - ## `jj version` Display version information diff --git a/docs/tutorial.md b/docs/tutorial.md index 76f8fc2a77b..d7688da53c2 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -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).