-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: run "op log" without loading repo or merging concurrent ops
When debugging behavior of badly-GCed repos, I find it's annoying that "op log" fails because the index can't be loaded. Since "op log" doesn't need a repo, I think it's better to display the exact op-heads state without merging.
- Loading branch information
Showing
3 changed files
with
47 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,21 @@ fn test_concurrent_operation_divergence() { | |
&["describe", "-m", "message 2", "--at-op", "@-"], | ||
); | ||
|
||
// "op log" doesn't merge the concurrent operations | ||
let stdout = test_env.jj_cmd_success(&repo_path, &["op", "log"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ 94fce7319d45 [email protected] 2001-02-03 04:05:09.000 +07:00 - 2001-02-03 04:05:09.000 +07:00 | ||
│ describe commit 230dd059e1b059aefc0da06a2e5a7dbf22362f22 | ||
│ args: jj describe -m 'message 2' --at-op @- | ||
│ ◉ 15e35d1e9190 [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 'message 1' | ||
◉ 19b8089fc78b [email protected] 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 | ||
│ add workspace 'default' | ||
◉ f1c462c494be [email protected] 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 | ||
initialize repo | ||
"###); | ||
|
||
// We should be informed about the concurrent modification | ||
let (stdout, stderr) = test_env.jj_cmd_ok(&repo_path, &["log", "-T", "description"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
|
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