Skip to content

Commit b205985

Browse files
committed
squash: document use of -A/-B/-d with --from and not -r
For me, the trickiest part of figuring out how to use the new options was to realize that I should assume `--from @` when using them, and that I should not think of `-r` at all. We still need more docs, but I think this would be a helpful pointer for experienced users wanting to experiment with this.
1 parent af12944 commit b205985

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

cli/src/commands/squash.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,16 @@ use crate::ui::Ui;
6767
///
6868
/// If a working-copy commit gets abandoned, it will be given a new, empty
6969
/// commit. This is true in general; it is not specific to this command.
70+
///
71+
/// EXPERIMENTAL FEATURES
72+
///
73+
/// An alternative squashing UI is available via the `-d`, `-A`, and `-B`
74+
/// options. They can be used together with one or more `--from` options
75+
/// (if no `--from` is specified, `--from @` is assumed).
7076
#[derive(clap::Args, Clone, Debug)]
7177
pub(crate) struct SquashArgs {
72-
/// Revision to squash into its parent (default: @)
78+
/// Revision to squash into its parent (default: @). Incompatible with the
79+
/// experimental `-d`/`-A`/`-B` options.
7380
#[arg(
7481
long,
7582
short,

cli/tests/[email protected]

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2590,6 +2590,10 @@ If the source was abandoned and both the source and destination had a non-empty
25902590

25912591
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.
25922592

2593+
EXPERIMENTAL FEATURES
2594+
2595+
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).
2596+
25932597
**Usage:** `jj squash [OPTIONS] [FILESETS]...`
25942598

25952599
###### **Arguments:**
@@ -2598,7 +2602,7 @@ If a working-copy commit gets abandoned, it will be given a new, empty commit. T
25982602

25992603
###### **Options:**
26002604

2601-
* `-r`, `--revision <REVSET>` — Revision to squash into its parent (default: @)
2605+
* `-r`, `--revision <REVSET>` — Revision to squash into its parent (default: @). Incompatible with the experimental `-d`/`-A`/`-B` options
26022606
* `-f`, `--from <REVSETS>` — Revision(s) to squash from (default: @)
26032607
* `-t`, `--into <REVSET>` [alias: `to`] — Revision to squash into (default: @)
26042608
* `-d`, `--destination <REVSETS>` — (Experimental) The revision(s) to use as parent for the new commit (can be repeated to create a merge commit)

0 commit comments

Comments
 (0)