From 8b825796ff91281db31929e5437f64d269c98612 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Fri, 8 Sep 2023 08:37:38 +0900 Subject: [PATCH] cli: rewrite "x | x-" in default log revset as "ancestors(x, 2)" --- cli/src/commands/mod.rs | 5 ++--- cli/src/config-schema.json | 2 +- lib/src/settings.rs | 5 +---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/cli/src/commands/mod.rs b/cli/src/commands/mod.rs index 349a9aafe..4e2be8d64 100644 --- a/cli/src/commands/mod.rs +++ b/cli/src/commands/mod.rs @@ -354,9 +354,8 @@ struct StatusArgs {} /// Show commit history #[derive(clap::Args, Clone, Debug)] struct LogArgs { - /// Which revisions to show. Defaults to the `revsets.log` setting, - /// or `@ | (remote_branches() | tags()).. | ((remote_branches() | - /// tags())..)-` if it is not set. + /// Which revisions to show. Defaults to the `revsets.log` setting, or + /// `@ | ancestors((remote_branches() | tags()).., 2)` if it is not set. #[arg(long, short)] revisions: Vec, /// Show commits modifying the given paths diff --git a/cli/src/config-schema.json b/cli/src/config-schema.json index 0f5ca8c60..dce53bb29 100644 --- a/cli/src/config-schema.json +++ b/cli/src/config-schema.json @@ -294,7 +294,7 @@ "log": { "type": "string", "description": "Default set of revisions to show when no explicit revset is given for jj log and similar commands", - "default": "@ | (remote_branches() | tags()).. | ((remote_branches() | tags())..)-" + "default": "@ | ancestors((remote_branches() | tags()).., 2)" }, "short-prefixes": { "type": "string", diff --git a/lib/src/settings.rs b/lib/src/settings.rs index 1aef61cf2..372000c00 100644 --- a/lib/src/settings.rs +++ b/lib/src/settings.rs @@ -159,10 +159,7 @@ impl UserSettings { // For compatibility with old config files (<0.8.0) self.config .get_string("ui.default-revset") - .unwrap_or_else(|_| { - "@ | (remote_branches() | tags()).. | ((remote_branches() | tags())..)-" - .to_string() - }) + .unwrap_or_else(|_| "@ | ancestors((remote_branches() | tags()).., 2)".to_string()) }) }