From 7d23f4338682d31c7c9dade6d906e7b51b218cb6 Mon Sep 17 00:00:00 2001 From: Noah Mayr Date: Mon, 1 Apr 2024 12:08:50 +0200 Subject: [PATCH] docs: document that default log revset is only used when neither path nor revset is specified --- cli/src/commands/log.rs | 5 +++-- cli/tests/cli-reference@.md.snap | 2 +- docs/config.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cli/src/commands/log.rs b/cli/src/commands/log.rs index f7024a3540..7334b5a818 100644 --- a/cli/src/commands/log.rs +++ b/cli/src/commands/log.rs @@ -38,8 +38,9 @@ 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. Defaults to the `revsets.log` setting, or - /// `@ | ancestors(immutable_heads().., 2) | trunk()` if it is not set. + /// Which revisions to show. If no paths are specified, this defaults to the + /// `revsets.log` setting, or `@ | ancestors(immutable_heads().., 2) | + /// trunk()` if it is not set. #[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 8ff377a2f0..efd1becab7 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -1025,7 +1025,7 @@ Spans of revisions that are not included in the graph per `--revisions` are rend ###### **Options:** -* `-r`, `--revisions ` — Which revisions to show. 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 are specified, this defaults to the `revsets.log` setting, or `@ | ancestors(immutable_heads().., 2) | trunk()` if it is not set * `--reversed` — Show revisions in the opposite order (older revisions first) Possible values: `true`, `false` diff --git a/docs/config.md b/docs/config.md index 6ff3b99add..d8d8013ad3 100644 --- a/docs/config.md +++ b/docs/config.md @@ -215,7 +215,7 @@ immutable even if the set is empty. ### Default revisions to log -You can configure the revisions `jj log` without `-r` should show. +You can configure the revisions `jj log` without `-r` or any specified paths should show. ```toml # Show commits that are not in `main@origin`