-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: apply log --limit before --reversed
As I said, I don't have strong feeling about the current behavior, and appears that "log | head | reverse" is preferred over "log | reverse | head". "jj evolog" already behaves differently, so I just updated the doc. Note that the new behavior might be slightly different from git, but nobody would care. (iirc, in git, topological sorting comes later.) Closes #5403
- Loading branch information
Showing
8 changed files
with
92 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -370,6 +370,17 @@ fn test_evolog_reversed_no_graph() { | |
qpvuntsm [email protected] 2001-02-03 08:05:10 5cb22a87 | ||
(empty) c | ||
"); | ||
|
||
let stdout = test_env.jj_cmd_success( | ||
&repo_path, | ||
&["evolog", "--limit=2", "--reversed", "--no-graph"], | ||
); | ||
insta::assert_snapshot!(stdout, @r" | ||
qpvuntsm hidden [email protected] 2001-02-03 08:05:09 b4584f54 | ||
(empty) b | ||
qpvuntsm [email protected] 2001-02-03 08:05:10 5cb22a87 | ||
(empty) c | ||
"); | ||
} | ||
|
||
#[test] | ||
|
@@ -415,4 +426,17 @@ fn test_evolog_reverse_with_graph() { | |
○ qpvuntsm [email protected] 2001-02-03 08:05:13 a177c2f2 | ||
(empty) c+d+e | ||
"); | ||
|
||
let stdout = test_env.jj_cmd_success( | ||
&repo_path, | ||
&["evolog", "-rdescription(c+d+e)", "--limit=3", "--reversed"], | ||
); | ||
insta::assert_snapshot!(stdout, @r" | ||
○ mzvwutvl hidden [email protected] 2001-02-03 08:05:11 280cbb6e | ||
│ (empty) d | ||
│ ○ royxmykx hidden [email protected] 2001-02-03 08:05:12 031df638 | ||
├─╯ (empty) e | ||
○ qpvuntsm [email protected] 2001-02-03 08:05:13 a177c2f2 | ||
(empty) c+d+e | ||
"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,12 +250,32 @@ fn test_op_log_reversed() { | |
"#); | ||
|
||
// Should work correctly with `--limit` | ||
let stdout = test_env.jj_cmd_success(&repo_path, &["op", "log", "--reversed", "--limit=2"]); | ||
insta::assert_snapshot!(stdout, @r#" | ||
○ 000000000000 root() | ||
○ eac759b9ab75 [email protected] 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 | ||
├─╮ add workspace 'default' | ||
"#); | ||
let stdout = test_env.jj_cmd_success(&repo_path, &["op", "log", "--reversed", "--limit=3"]); | ||
insta::assert_snapshot!(stdout, @r" | ||
○ 8e3e726be123 [email protected] 2001-02-03 04:05:10.000 +07:00 - 2001-02-03 04:05:10.000 +07:00 | ||
│ describe commit 230dd059e1b059aefc0da06a2e5a7dbf22362f22 | ||
│ args: jj describe -m 'description 1' --at-op @- | ||
│ ○ d009cfc04993 [email protected] 2001-02-03 04:05:08.000 +07:00 - 2001-02-03 04:05:08.000 +07:00 | ||
├─╯ describe commit 230dd059e1b059aefc0da06a2e5a7dbf22362f22 | ||
│ args: jj describe -m 'description 0' | ||
@ e4538ffdc13d [email protected] 2001-02-03 04:05:11.000 +07:00 - 2001-02-03 04:05:11.000 +07:00 | ||
reconcile divergent operations | ||
args: jj op log --reversed | ||
"); | ||
|
||
// Should work correctly with `--limit` and `--no-graph` | ||
let stdout = test_env.jj_cmd_success( | ||
&repo_path, | ||
&["op", "log", "--reversed", "--limit=2", "--no-graph"], | ||
); | ||
insta::assert_snapshot!(stdout, @r" | ||
d009cfc04993 [email protected] 2001-02-03 04:05:08.000 +07:00 - 2001-02-03 04:05:08.000 +07:00 | ||
describe commit 230dd059e1b059aefc0da06a2e5a7dbf22362f22 | ||
args: jj describe -m 'description 0' | ||
e4538ffdc13d [email protected] 2001-02-03 04:05:11.000 +07:00 - 2001-02-03 04:05:11.000 +07:00 | ||
reconcile divergent operations | ||
args: jj op log --reversed | ||
"); | ||
} | ||
|
||
#[test] | ||
|