mirror of
https://github.com/martinvonz/jj.git
synced 2024-11-28 09:14:04 +00:00
cli: make default log revset work without working-copy commit
Spotted while adding an error propagation path from IdPrefixContext.
This commit is contained in:
parent
1f5835c267
commit
0a8d8dad67
4 changed files with 17 additions and 3 deletions
|
@ -389,7 +389,7 @@
|
|||
"log": {
|
||||
"type": "string",
|
||||
"description": "Default set of revisions to show when no explicit revset is given for jj log and similar commands",
|
||||
"default": "@ | ancestors(immutable_heads().., 2) | trunk()"
|
||||
"default": "present(@) | ancestors(immutable_heads().., 2) | trunk()"
|
||||
},
|
||||
"short-prefixes": {
|
||||
"type": "string",
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
[revsets]
|
||||
fix = "reachable(@, mutable())"
|
||||
log = "@ | ancestors(immutable_heads().., 2) | trunk()"
|
||||
log = "present(@) | ancestors(immutable_heads().., 2) | trunk()"
|
||||
|
||||
[revset-aliases]
|
||||
'trunk()' = '''
|
||||
|
|
|
@ -217,6 +217,19 @@ fn test_log_default() {
|
|||
"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_log_default_without_working_copy() {
|
||||
let test_env = TestEnvironment::default();
|
||||
test_env.jj_cmd_ok(test_env.env_root(), &["git", "init", "repo"]);
|
||||
let repo_path = test_env.env_root().join("repo");
|
||||
|
||||
test_env.jj_cmd_ok(&repo_path, &["workspace", "forget"]);
|
||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log"]);
|
||||
insta::assert_snapshot!(stdout, @r#"
|
||||
◆ zzzzzzzz root() 00000000
|
||||
"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_log_builtin_templates() {
|
||||
let test_env = TestEnvironment::default();
|
||||
|
|
|
@ -289,7 +289,8 @@ You can configure the revisions `jj log` would show when neither `-r` nor any pa
|
|||
revsets.log = "main@origin.."
|
||||
```
|
||||
|
||||
The default value for `revsets.log` is `'@ | ancestors(immutable_heads().., 2) | trunk()'`.
|
||||
The default value for `revsets.log` is
|
||||
`'present(@) | ancestors(immutable_heads().., 2) | trunk()'`.
|
||||
|
||||
### Graph style
|
||||
|
||||
|
|
Loading…
Reference in a new issue