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]
+40-7Lines changed: 40 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 amend`↴](#jj-amend)
39
40
* [`jj duplicate`↴](#jj-duplicate)
40
41
* [`jj edit`↴](#jj-edit)
41
42
* [`jj evolog`↴](#jj-evolog)
@@ -141,6 +142,7 @@ To get started, see the tutorial [`jj help -k tutorial`].
141
142
* `describe` — Update the change description or other metadata [default alias: desc]
142
143
* `diff` — Compare file contents between two revisions
143
144
* `diffedit` — Touch up the content changes in a revision with a diff editor
145
+
* `amend` — Move changes from a revision into another revision
144
146
* `duplicate` — Create new changes with the same content as existing ones
145
147
* `edit` — Sets the specified revision as the working-copy revision
146
148
* `evolog` — Show how a change has evolved over time
@@ -168,7 +170,7 @@ To get started, see the tutorial [`jj help -k tutorial`].
168
170
* `simplify-parents` — Simplify parent edges for the specified revision(s)
169
171
* `sparse` — Manage which paths from the working-copy commit are present in the working copy
170
172
* `split` — Split a revision in two
171
-
* `squash` — Move changes from a revision into another revision
173
+
* `squash` — Combine revisions by moving changes from a revision into another revision
172
174
* `status` — Show high-level repo status [default alias: st]
173
175
* `tag` — Manage tags
174
176
* `undo` — Undo the last operation
@@ -909,6 +911,35 @@ See `jj restore` if you want to move entire files from one revision to another.
909
911
910
912
911
913
914
+
## `jj amend`
915
+
916
+
Move changes from a revision into another revision
917
+
918
+
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).
919
+
920
+
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.
921
+
922
+
EXPERIMENTAL FEATURES
923
+
924
+
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).
925
+
926
+
**Usage:** `jj amend [OPTIONS] [FILESETS]...`
927
+
928
+
###### **Arguments:**
929
+
930
+
* `<FILESETS>` — Move only changes to these paths (instead of all paths)
931
+
932
+
###### **Options:**
933
+
934
+
* `-r`, `--revision <REVSET>` — Revision to squash into its parent (default: @). Incompatible with the experimental `-d`/`-A`/`-B` options
935
+
* `-f`, `--from <REVSETS>` — Revision(s) to squash from (default: @)
936
+
* `-t`, `--into <REVSET>` [alias: `to`] — Revision to squash into (default: @)
937
+
* `-i`, `--interactive` — Interactively choose which parts to squash
938
+
* `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
939
+
* `-m`, `--message <MESSAGE>` — The description to overwrite for the destination revision
940
+
941
+
942
+
912
943
## `jj duplicate`
913
944
914
945
Create new changes with the same content as existing ones
@@ -2715,13 +2746,15 @@ Splitting an empty commit is not supported because the same effect can be achiev
2715
2746
2716
2747
## `jj squash`
2717
2748
2718
-
Move changes from a revision into another revision
2749
+
Combine revisions by moving changes from a revision into another revision.
2750
+
2751
+
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 amend`.
2719
2752
2720
2753
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).
2721
2754
2722
2755
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.
2723
2756
2724
-
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.
2757
+
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.
2725
2758
2726
2759
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.
2727
2760
@@ -2742,13 +2775,13 @@ An alternative squashing UI is available via the `-d`, `-A`, and `-B` options. T
2742
2775
* `-r`, `--revision <REVSET>` — Revision to squash into its parent (default: @). Incompatible with the experimental `-d`/`-A`/`-B` options
2743
2776
* `-f`, `--from <REVSETS>` — Revision(s) to squash from (default: @)
2744
2777
* `-t`, `--into <REVSET>` [alias: `to`] — Revision to squash into (default: @)
2778
+
* `-i`, `--interactive` — Interactively choose which parts to squash
2779
+
* `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
2780
+
* `-m`, `--message <MESSAGE>` — The description to use for squashed revision (don't open editor)
2781
+
* `-u`, `--use-destination-message` — Use the description of the destination revision and discard the description(s) of the source revision(s)
2745
2782
* `-d`, `--destination <REVSETS>` — (Experimental) The revision(s) to use as parent for the new commit (can be repeated to create a merge commit)
2746
2783
* `-A`, `--insert-after <REVSETS>` [alias: `after`] — (Experimental) The revision(s) to insert the new commit after (can be repeated to create a merge commit)
2747
2784
* `-B`, `--insert-before <REVSETS>` [alias: `before`] — (Experimental) The revision(s) to insert the new commit before (can be repeated to create a merge commit)
2748
-
* `-m`, `--message <MESSAGE>` — The description to use for squashed revision (don't open editor)
2749
-
* `-u`, `--use-destination-message` — Use the description of the destination revision and discard the description(s) of the source revision(s)
2750
-
* `-i`, `--interactive` — Interactively choose which parts to squash
2751
-
* `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
2752
2785
* `-k`, `--keep-emptied` — The source revision will not be abandoned
0 commit comments