···5151* The `tags()` revset function now takes an optional `pattern` argument,
5252 mirroring that of `bookmarks()`.
53535454+* Several commands now support `-f/-t` shorthands for `--from/--to`:
5555+ - `diff`
5656+ - `diffedit`
5757+ - `interdiff`
5858+ - `op diff`
5959+ - `restore`
6060+5461### Fixed bugs
55625663* `jj config unset <TABLE-NAME>` no longer removes a table (such as `[ui]`.)
+2-2
cli/src/commands/diff.rs
···5151 #[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))]
5252 revision: Option<RevisionArg>,
5353 /// Show changes from this revision
5454- #[arg(long, conflicts_with = "revision", add = ArgValueCandidates::new(complete::all_revisions))]
5454+ #[arg(long, short, conflicts_with = "revision", add = ArgValueCandidates::new(complete::all_revisions))]
5555 from: Option<RevisionArg>,
5656 /// Show changes to this revision
5757- #[arg(long, conflicts_with = "revision", add = ArgValueCandidates::new(complete::all_revisions))]
5757+ #[arg(long, short, conflicts_with = "revision", add = ArgValueCandidates::new(complete::all_revisions))]
5858 to: Option<RevisionArg>,
5959 /// Restrict the diff to these paths
6060 #[arg(value_hint = clap::ValueHint::AnyPath)]
+10-2
cli/src/commands/diffedit.rs
···5555 /// Show changes from this revision
5656 ///
5757 /// Defaults to @ if --to is specified.
5858- #[arg(long, conflicts_with = "revision", add = ArgValueCandidates::new(complete::all_revisions))]
5858+ #[arg(
5959+ long, short,
6060+ conflicts_with = "revision",
6161+ add = ArgValueCandidates::new(complete::all_revisions),
6262+ )]
5963 from: Option<RevisionArg>,
6064 /// Edit changes in this revision
6165 ///
6266 /// Defaults to @ if --from is specified.
6363- #[arg(long, conflicts_with = "revision", add = ArgValueCandidates::new(complete::mutable_revisions))]
6767+ #[arg(
6868+ long, short,
6969+ conflicts_with = "revision",
7070+ add = ArgValueCandidates::new(complete::mutable_revisions),
7171+ )]
6472 to: Option<RevisionArg>,
6573 /// Specify diff editor to be used
6674 #[arg(long, value_name = "NAME")]
+2-2
cli/src/commands/interdiff.rs
···3636#[command(mut_arg("ignore_space_change", |a| a.short('b')))]
3737pub(crate) struct InterdiffArgs {
3838 /// Show changes from this revision
3939- #[arg(long, add = ArgValueCandidates::new(complete::all_revisions))]
3939+ #[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))]
4040 from: Option<RevisionArg>,
4141 /// Show changes to this revision
4242- #[arg(long, add = ArgValueCandidates::new(complete::all_revisions))]
4242+ #[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))]
4343 to: Option<RevisionArg>,
4444 /// Restrict the diff to these paths
4545 #[arg(value_hint = clap::ValueHint::AnyPath)]
+2-2
cli/src/commands/operation/diff.rs
···6565 operation: Option<String>,
6666 /// Show repository changes from this operation
6767 #[arg(
6868- long,
6868+ long, short,
6969 conflicts_with = "operation",
7070 add = ArgValueCandidates::new(complete::operations),
7171 )]
7272 from: Option<String>,
7373 /// Show repository changes to this operation
7474 #[arg(
7575- long,
7575+ long, short,
7676 conflicts_with = "operation",
7777 add = ArgValueCandidates::new(complete::operations),
7878 )]
+2-2
cli/src/commands/restore.rs
···4848 #[arg(value_hint = clap::ValueHint::AnyPath)]
4949 paths: Vec<String>,
5050 /// Revision to restore from (source)
5151- #[arg(long, add = ArgValueCandidates::new(complete::all_revisions))]
5151+ #[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))]
5252 from: Option<RevisionArg>,
5353 /// Revision to restore into (destination)
5454- #[arg(long, add = ArgValueCandidates::new(complete::mutable_revisions))]
5454+ #[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))]
5555 to: Option<RevisionArg>,
5656 /// Undo the changes in a revision as compared to the merge of its parents.
5757 ///
+11-10
cli/tests/cli-reference@.md.snap
···11---
22source: cli/tests/test_generate_md_cli_help.rs
33description: "AUTO-GENERATED FILE, DO NOT EDIT. This cli reference is generated by a test as an `insta` snapshot. MkDocs includes this snapshot from docs/cli-reference.md."
44+snapshot_kind: text
45---
56<!-- BEGIN MARKDOWN-->
67···689690* `-r`, `--revision <REVISION>` — Show changes in this revision, compared to its parent(s)
690691691692 If the revision is a merge commit, this shows changes *from* the automatic merge of the contents of all of its parents *to* the contents of the revision itself.
692692-* `--from <FROM>` — Show changes from this revision
693693-* `--to <TO>` — Show changes to this revision
693693+* `-f`, `--from <FROM>` — Show changes from this revision
694694+* `-t`, `--to <TO>` — Show changes to this revision
694695* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
695696* `--stat` — Show a histogram of the changes
696697* `--types` — For each path, show only its type before and after
···729730* `-r`, `--revision <REVISION>` — The revision to touch up
730731731732 Defaults to @ if neither --to nor --from are specified.
732732-* `--from <FROM>` — Show changes from this revision
733733+* `-f`, `--from <FROM>` — Show changes from this revision
733734734735 Defaults to @ if --to is specified.
735735-* `--to <TO>` — Edit changes in this revision
736736+* `-t`, `--to <TO>` — Edit changes in this revision
736737737738 Defaults to @ if --from is specified.
738739* `--tool <NAME>` — Specify diff editor to be used
···1316131713171318###### **Options:**
1318131913191319-* `--from <FROM>` — Show changes from this revision
13201320-* `--to <TO>` — Show changes to this revision
13201320+* `-f`, `--from <FROM>` — Show changes from this revision
13211321+* `-t`, `--to <TO>` — Show changes to this revision
13211322* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
13221323* `--stat` — Show a histogram of the changes
13231324* `--types` — For each path, show only its type before and after
···15101511###### **Options:**
1511151215121513* `--operation <OPERATION>` — Show repository changes in this operation, compared to its parent
15131513-* `--from <FROM>` — Show repository changes from this operation
15141514-* `--to <TO>` — Show repository changes to this operation
15141514+* `-f`, `--from <FROM>` — Show repository changes from this operation
15151515+* `-t`, `--to <TO>` — Show repository changes to this operation
15151516* `--no-graph` — Don't show the graph, show a flat list of modified changes
15161517* `-p`, `--patch` — Show patch of modifications to changes
15171518···1913191419141915###### **Options:**
1915191619161916-* `--from <FROM>` — Revision to restore from (source)
19171917-* `--to <TO>` — Revision to restore into (destination)
19171917+* `-f`, `--from <FROM>` — Revision to restore from (source)
19181918+* `-t`, `--to <TO>` — Revision to restore into (destination)
19181919* `-c`, `--changes-in <REVISION>` — Undo the changes in a revision as compared to the merge of its parents.
1919192019201921 This undoes the changes that can be seen with `jj diff -r REVISION`. If `REVISION` only has a single parent, this option is equivalent to `jj restore --to REVISION --from REVISION-`.
+4-4
cli/tests/test_global_opts.rs
···642642 let test_env = TestEnvironment::default();
643643644644 let stdout = test_env.jj_cmd_success(test_env.env_root(), &["diffedit", "-h"]);
645645- insta::assert_snapshot!(stdout, @r#"
645645+ insta::assert_snapshot!(stdout, @r"
646646 Touch up the content changes in a revision with a diff editor
647647648648 Usage: jj diffedit [OPTIONS]
649649650650 Options:
651651 -r, --revision <REVISION> The revision to touch up
652652- --from <FROM> Show changes from this revision
653653- --to <TO> Edit changes in this revision
652652+ -f, --from <FROM> Show changes from this revision
653653+ -t, --to <TO> Edit changes in this revision
654654 --tool <NAME> Specify diff editor to be used
655655 --restore-descendants Preserve the content (not the diff) when rebasing descendants
656656 -h, --help Print help (see more with '--help')
···665665 --quiet Silence non-primary command output
666666 --no-pager Disable the pager
667667 --config-toml <TOML> Additional configuration options (can be repeated)
668668- "#);
668668+ ");
669669}
670670671671#[test]