Skip to content

Commit

Permalink
cli: rewrite "x | x-" in default log revset as "ancestors(x, 2)"
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Sep 8, 2023
1 parent 5fc7101 commit 1e46114
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 2 additions & 3 deletions cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RevisionArg>,
/// Show commits modifying the given paths
Expand Down
2 changes: 1 addition & 1 deletion cli/src/config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 1 addition & 4 deletions lib/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
})
}

Expand Down

0 comments on commit 1e46114

Please sign in to comment.