You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cli: Split jj squash into jj squash and jj movediff
As has been discussed in several places, `jj squash` is a very
complicated command that can do many things.
`jj movediff` is much simpler to explain ("moves diffs from one commit
to another").
It is implemented in terms of squash because the difference between the
two is more semantic than programatic.
In the future, we *may* consider removing the ability for squash to
operate on individual files, but that is still hotly debated.
Copy file name to clipboardExpand all lines: cli/tests/[email protected]
+39-7Lines changed: 39 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@ This document contains the help content for the `jj` command-line program.
36
36
* [`jj describe`↴](#jj-describe)
37
37
* [`jj diff`↴](#jj-diff)
38
38
* [`jj diffedit`↴](#jj-diffedit)
39
+
* [`jj diffmove`↴](#jj-diffmove)
39
40
* [`jj duplicate`↴](#jj-duplicate)
40
41
* [`jj edit`↴](#jj-edit)
41
42
* [`jj evolog`↴](#jj-evolog)
@@ -139,6 +140,7 @@ To get started, see the tutorial [`jj help -k tutorial`].
139
140
* `describe` — Update the change description or other metadata [default alias: desc]
140
141
* `diff` — Compare file contents between two revisions
141
142
* `diffedit` — Touch up the content changes in a revision with a diff editor
143
+
* `diffmove` — Move changes from a revision into another revision
142
144
* `duplicate` — Create new changes with the same content as existing ones
143
145
* `edit` — Sets the specified revision as the working-copy revision
144
146
* `evolog` — Show how a change has evolved over time
@@ -166,7 +168,7 @@ To get started, see the tutorial [`jj help -k tutorial`].
166
168
* `simplify-parents` — Simplify parent edges for the specified revision(s)
167
169
* `sparse` — Manage which paths from the working-copy commit are present in the working copy
168
170
* `split` — Split a revision in two
169
-
* `squash` — Move changes from a revision into another revision
171
+
* `squash` — Combine revisions by moving changes from a revision into another revision
170
172
* `status` — Show high-level repo status [default alias: st]
171
173
* `tag` — Manage tags
172
174
* `undo` — Undo the last operation
@@ -892,6 +894,34 @@ See `jj restore` if you want to move entire files from one revision to another.
892
894
893
895
894
896
897
+
## `jj diffmove`
898
+
899
+
Move changes from a revision into another revision
900
+
901
+
With the `-r` option, moves the changes from the specified revision to the parent revision. Fails if there are several parent revisions (i.e., the given revision is a merge).
902
+
903
+
With the `--from` and/or `--into` options, moves changes from/to the given revisions. If either is left out, it defaults to the working-copy commit. For example, `jj squash --into @--` moves changes from the working-copy commit to the grandparent.
904
+
905
+
EXPERIMENTAL FEATURES
906
+
907
+
An alternative squashing UI is available via the `-d`, `-A`, and `-B` options. They can be used together with one or more `--from` options (if no `--from` is specified, `--from @` is assumed).
908
+
909
+
**Usage:** `jj diffmove [OPTIONS] [FILESETS]...`
910
+
911
+
###### **Arguments:**
912
+
913
+
* `<FILESETS>` — Move only changes to these paths (instead of all paths)
914
+
915
+
###### **Options:**
916
+
917
+
* `-r`, `--revision <REVSET>` — Revision to squash into its parent (default: @). Incompatible with the experimental `-d`/`-A`/`-B` options
918
+
* `-f`, `--from <REVSETS>` — Revision(s) to squash from (default: @)
919
+
* `-t`, `--into <REVSET>` [alias: `to`] — Revision to squash into (default: @)
920
+
* `-i`, `--interactive` — Interactively choose which parts to squash
921
+
* `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
922
+
923
+
924
+
895
925
## `jj duplicate`
896
926
897
927
Create new changes with the same content as existing ones
@@ -2698,13 +2728,15 @@ Splitting an empty commit is not supported because the same effect can be achiev
2698
2728
2699
2729
## `jj squash`
2700
2730
2701
-
Move changes from a revision into another revision
2731
+
Combine revisions by moving changes from a revision into another revision.
2732
+
2733
+
Note: If you aren't trying to merge the revision metadata (eg. description, bookmarks), or if you want to do a partial squash, you probably want `jj movediff`.
2702
2734
2703
2735
With the `-r` option, moves the changes from the specified revision to the parent revision. Fails if there are several parent revisions (i.e., the given revision is a merge).
2704
2736
2705
2737
With the `--from` and/or `--into` options, moves changes from/to the given revisions. If either is left out, it defaults to the working-copy commit. For example, `jj squash --into @--` moves changes from the working-copy commit to the grandparent.
2706
2738
2707
-
If, after moving changes out, the source revision is empty compared to its parent(s), and `--keep-emptied` is not set, it will be abandoned. Without `--interactive` or paths, the source revision will always be empty.
2739
+
If, after moving changes out, the source revision is empty compared to its parent(s), it will be abandoned. Without `--interactive` or paths, the source revision will always be empty.
2708
2740
2709
2741
If the source was abandoned 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.
2710
2742
@@ -2725,13 +2757,13 @@ An alternative squashing UI is available via the `-d`, `-A`, and `-B` options. T
2725
2757
* `-r`, `--revision <REVSET>` — Revision to squash into its parent (default: @). Incompatible with the experimental `-d`/`-A`/`-B` options
2726
2758
* `-f`, `--from <REVSETS>` — Revision(s) to squash from (default: @)
2727
2759
* `-t`, `--into <REVSET>` [alias: `to`] — Revision to squash into (default: @)
2760
+
* `-i`, `--interactive` — Interactively choose which parts to squash
2761
+
* `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
2762
+
* `-m`, `--message <MESSAGE>` — The description to use for squashed revision (don't open editor)
2763
+
* `-u`, `--use-destination-message` — Use the description of the destination revision and discard the description(s) of the source revision(s)
2728
2764
* `-d`, `--destination <REVSETS>` — (Experimental) The revision(s) to use as parent for the new commit (can be repeated to create a merge commit)
2729
2765
* `-A`, `--insert-after <REVSETS>` [alias: `after`] — (Experimental) The revision(s) to insert the new commit after (can be repeated to create a merge commit)
2730
2766
* `-B`, `--insert-before <REVSETS>` [alias: `before`] — (Experimental) The revision(s) to insert the new commit before (can be repeated to create a merge commit)
2731
-
* `-m`, `--message <MESSAGE>` — The description to use for squashed revision (don't open editor)
2732
-
* `-u`, `--use-destination-message` — Use the description of the destination revision and discard the description(s) of the source revision(s)
2733
-
* `-i`, `--interactive` — Interactively choose which parts to squash
2734
-
* `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
2735
2767
* `-k`, `--keep-emptied` — The source revision will not be abandoned
0 commit comments