From 1f5835c2677d29c2d76e733a5c4dc11231406776 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Tue, 1 Oct 2024 09:11:46 +0900 Subject: [PATCH] cli: simplify help about default "log -r" Since we've moved the default log revset to config/*.toml at 3dab92d2, we don't have to repeat the default value. It can be queried by "jj config list". I also split the help paragraphs. --- cli/src/commands/log.rs | 7 ++++--- cli/tests/cli-reference@.md.snap | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cli/src/commands/log.rs b/cli/src/commands/log.rs index 0daf0c24a4..b3a11313a7 100644 --- a/cli/src/commands/log.rs +++ b/cli/src/commands/log.rs @@ -46,9 +46,10 @@ use crate::ui::Ui; /// rendered as a synthetic node labeled "(elided revisions)". #[derive(clap::Args, Clone, Debug)] pub(crate) struct LogArgs { - /// Which revisions to show. If no paths nor revisions are specified, this - /// defaults to the `revsets.log` setting, or `@ | - /// ancestors(immutable_heads().., 2) | trunk()` if it is not set. + /// Which revisions to show + /// + /// If no paths nor revisions are specified, this defaults to the + /// `revsets.log` setting. #[arg(long, short)] revisions: Vec, /// Show revisions modifying the given paths diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index 07d888757c..62e8ed40c0 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -1221,7 +1221,9 @@ Spans of revisions that are not included in the graph per `--revisions` are rend ###### **Options:** -* `-r`, `--revisions ` — Which revisions to show. If no paths nor revisions are specified, this defaults to the `revsets.log` setting, or `@ | ancestors(immutable_heads().., 2) | trunk()` if it is not set +* `-r`, `--revisions ` — Which revisions to show + + If no paths nor revisions are specified, this defaults to the `revsets.log` setting. * `--reversed` — Show revisions in the opposite order (older revisions first) * `-n`, `--limit ` — Limit number of revisions to show