-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: show timestamp in local timezone and without millis and offset
As discussed in #2900, the milliseconds are rarely useful, and it can be confusing with different timezones because it makes harder to compare timestamps. Closes #2900
- Loading branch information
1 parent
c32b68e
commit b632881
Showing
19 changed files
with
169 additions
and
171 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,7 @@ impl TestEnvironment { | |
} | ||
cmd.env("RUST_BACKTRACE", "1"); | ||
cmd.env("HOME", self.home_dir.to_str().unwrap()); | ||
cmd.env("TZ", "UTC-11:00"); | ||
cmd.env("JJ_CONFIG", self.config_path.to_str().unwrap()); | ||
cmd.env("JJ_USER", "Test User"); | ||
cmd.env("JJ_EMAIL", "[email protected]"); | ||
|
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 |
---|---|---|
|
@@ -329,7 +329,7 @@ fn test_double_abandon() { | |
insta::assert_snapshot!( | ||
test_env.jj_cmd_success(&repo_path, &["log", "--no-graph", "-r", "a"]) | ||
, @r###" | ||
rlvkpnrz [email protected] 2001-02-03 04:05:09.000 +07:00 a 2443ea76 | ||
rlvkpnrz [email protected] 2001-02-03 08:05:09 a 2443ea76 | ||
a | ||
"###); | ||
|
||
|
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 |
---|---|---|
|
@@ -52,7 +52,7 @@ fn test_builtin_alias_trunk_matches_main() { | |
|
||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "trunk()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ lzmmnrxq [email protected] 2001-02-03 04:05:08.000 +07:00 main 45a3aa29 | ||
◉ lzmmnrxq [email protected] 2001-02-03 08:05:08 main 45a3aa29 | ||
│ (empty) description 1 | ||
~ | ||
"###); | ||
|
@@ -64,7 +64,7 @@ fn test_builtin_alias_trunk_matches_master() { | |
|
||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "trunk()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ lzmmnrxq [email protected] 2001-02-03 04:05:08.000 +07:00 master 45a3aa29 | ||
◉ lzmmnrxq [email protected] 2001-02-03 08:05:08 master 45a3aa29 | ||
│ (empty) description 1 | ||
~ | ||
"###); | ||
|
@@ -76,7 +76,7 @@ fn test_builtin_alias_trunk_matches_trunk() { | |
|
||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "trunk()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ lzmmnrxq [email protected] 2001-02-03 04:05:08.000 +07:00 trunk 45a3aa29 | ||
◉ lzmmnrxq [email protected] 2001-02-03 08:05:08 trunk 45a3aa29 | ||
│ (empty) description 1 | ||
~ | ||
"###); | ||
|
@@ -91,7 +91,7 @@ fn test_builtin_alias_trunk_matches_exactly_one_commit() { | |
|
||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "trunk()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ lzmmnrxq [email protected] 2001-02-03 04:05:08.000 +07:00 main 45a3aa29 | ||
◉ lzmmnrxq [email protected] 2001-02-03 08:05:08 main 45a3aa29 | ||
│ (empty) description 1 | ||
~ | ||
"###); | ||
|
@@ -107,7 +107,7 @@ fn test_builtin_alias_trunk_override_alias() { | |
|
||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "trunk()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ lzmmnrxq [email protected] 2001-02-03 04:05:08.000 +07:00 override-trunk 45a3aa29 | ||
◉ lzmmnrxq [email protected] 2001-02-03 08:05:08 override-trunk 45a3aa29 | ||
│ (empty) description 1 | ||
~ | ||
"###); | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -676,14 +676,14 @@ fn test_diff_external_tool() { | |
|
||
insta::assert_snapshot!( | ||
test_env.jj_cmd_success(&repo_path, &["log", "-p", "--tool=fake-diff-editor"]), @r###" | ||
@ rlvkpnrz [email protected] 2001-02-03 04:05:09.000 +07:00 0cba70c7 | ||
@ rlvkpnrz [email protected] 2001-02-03 08:05:09 0cba70c7 | ||
│ (no description set) | ||
│ file1 | ||
│ file2 | ||
│ -- | ||
│ file2 | ||
│ file3 | ||
◉ qpvuntsm [email protected] 2001-02-03 04:05:08.000 +07:00 39b5a56f | ||
◉ qpvuntsm [email protected] 2001-02-03 08:05:08 39b5a56f | ||
│ (no description set) | ||
│ -- | ||
│ file1 | ||
|
@@ -696,8 +696,8 @@ fn test_diff_external_tool() { | |
test_env.jj_cmd_success(&repo_path, &["show", "--tool=fake-diff-editor"]), @r###" | ||
Commit ID: 0cba70c72186eabb5a2f91be63a8366b9f6da6c6 | ||
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp | ||
Author: Test User <[email protected]> (2001-02-03 04:05:08.000 +07:00) | ||
Committer: Test User <[email protected]> (2001-02-03 04:05:09.000 +07:00) | ||
Author: Test User <[email protected]> (2001-02-03 08:05:08) | ||
Committer: Test User <[email protected]> (2001-02-03 08:05:09) | ||
(no description set) | ||
|
@@ -743,8 +743,8 @@ fn test_diff_external_tool() { | |
insta::assert_snapshot!(stdout, @r###" | ||
Commit ID: 0cba70c72186eabb5a2f91be63a8366b9f6da6c6 | ||
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp | ||
Author: Test User <[email protected]> (2001-02-03 04:05:08.000 +07:00) | ||
Committer: Test User <[email protected]> (2001-02-03 04:05:09.000 +07:00) | ||
Author: Test User <[email protected]> (2001-02-03 08:05:08) | ||
Committer: Test User <[email protected]> (2001-02-03 08:05:09) | ||
(no description set) | ||
|
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 |
---|---|---|
|
@@ -91,7 +91,7 @@ fn test_git_export_undo() { | |
insta::assert_snapshot!(stdout, @""); | ||
insta::assert_snapshot!(stderr, @""); | ||
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["log", "-ra@git"]), @r###" | ||
@ qpvuntsm [email protected] 2001-02-03 04:05:07.000 +07:00 a 230dd059 | ||
@ qpvuntsm [email protected] 2001-02-03 08:05:07 a 230dd059 | ||
│ (empty) (no description set) | ||
~ | ||
"###); | ||
|
@@ -121,7 +121,7 @@ fn test_git_export_undo() { | |
insta::assert_snapshot!(stdout, @""); | ||
insta::assert_snapshot!(stderr, @""); | ||
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["log", "-ra@git"]), @r###" | ||
@ qpvuntsm [email protected] 2001-02-03 04:05:07.000 +07:00 a 230dd059 | ||
@ qpvuntsm [email protected] 2001-02-03 08:05:07 a 230dd059 | ||
│ (empty) (no description set) | ||
~ | ||
"###); | ||
|
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 |
---|---|---|
|
@@ -137,7 +137,7 @@ fn test_git_init_external(bare: bool) { | |
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "@-"]); | ||
insta::allow_duplicates! { | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ mwrttmos [email protected] 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a | ||
◉ mwrttmos [email protected] 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a | ||
│ My commit message | ||
~ | ||
"###); | ||
|
@@ -203,7 +203,7 @@ fn test_git_init_colocated_via_git_repo_path() { | |
// Check that the Git repo's HEAD got checked out | ||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "@-"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ mwrttmos [email protected] 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a | ||
◉ mwrttmos [email protected] 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a | ||
│ My commit message | ||
~ | ||
"###); | ||
|
@@ -212,7 +212,7 @@ fn test_git_init_colocated_via_git_repo_path() { | |
test_env.jj_cmd_ok(&workspace_root, &["new"]); | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "@-"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ sqpuoqvx [email protected] 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd | ||
◉ sqpuoqvx [email protected] 2001-02-03 08:05:07 HEAD@git f61b77cd | ||
│ (no description set) | ||
~ | ||
"###); | ||
|
@@ -240,7 +240,7 @@ fn test_git_init_colocated_via_git_repo_path_gitlink() { | |
// Check that the Git repo's HEAD got checked out | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "@-"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ mwrttmos [email protected] 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a | ||
◉ mwrttmos [email protected] 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a | ||
│ My commit message | ||
~ | ||
"###); | ||
|
@@ -249,7 +249,7 @@ fn test_git_init_colocated_via_git_repo_path_gitlink() { | |
test_env.jj_cmd_ok(&workspace_root, &["new"]); | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "@-"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ sqpuoqvx [email protected] 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd | ||
◉ sqpuoqvx [email protected] 2001-02-03 08:05:07 HEAD@git f61b77cd | ||
│ (no description set) | ||
~ | ||
"###); | ||
|
@@ -276,7 +276,7 @@ fn test_git_init_colocated_via_git_repo_path_symlink_directory() { | |
// Check that the Git repo's HEAD got checked out | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "@-"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ mwrttmos [email protected] 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a | ||
◉ mwrttmos [email protected] 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a | ||
│ My commit message | ||
~ | ||
"###); | ||
|
@@ -285,7 +285,7 @@ fn test_git_init_colocated_via_git_repo_path_symlink_directory() { | |
test_env.jj_cmd_ok(&workspace_root, &["new"]); | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "@-"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ sqpuoqvx [email protected] 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd | ||
◉ sqpuoqvx [email protected] 2001-02-03 08:05:07 HEAD@git f61b77cd | ||
│ (no description set) | ||
~ | ||
"###); | ||
|
@@ -315,7 +315,7 @@ fn test_git_init_colocated_via_git_repo_path_symlink_directory_without_bare_conf | |
// Check that the Git repo's HEAD got checked out | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "@-"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ mwrttmos [email protected] 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a | ||
◉ mwrttmos [email protected] 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a | ||
│ My commit message | ||
~ | ||
"###); | ||
|
@@ -324,7 +324,7 @@ fn test_git_init_colocated_via_git_repo_path_symlink_directory_without_bare_conf | |
test_env.jj_cmd_ok(&workspace_root, &["new"]); | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "@-"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ sqpuoqvx [email protected] 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd | ||
◉ sqpuoqvx [email protected] 2001-02-03 08:05:07 HEAD@git f61b77cd | ||
│ (no description set) | ||
~ | ||
"###); | ||
|
@@ -356,7 +356,7 @@ fn test_git_init_colocated_via_git_repo_path_symlink_gitlink() { | |
// Check that the Git repo's HEAD got checked out | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "@-"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ mwrttmos [email protected] 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a | ||
◉ mwrttmos [email protected] 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a | ||
│ My commit message | ||
~ | ||
"###); | ||
|
@@ -365,7 +365,7 @@ fn test_git_init_colocated_via_git_repo_path_symlink_gitlink() { | |
test_env.jj_cmd_ok(&workspace_root, &["new"]); | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "@-"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ sqpuoqvx [email protected] 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd | ||
◉ sqpuoqvx [email protected] 2001-02-03 08:05:07 HEAD@git f61b77cd | ||
│ (no description set) | ||
~ | ||
"###); | ||
|
@@ -479,12 +479,12 @@ fn test_git_init_colocated_dirty_working_copy() { | |
// Working-copy changes should have been snapshotted. | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-s", "--ignore-working-copy"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
@ sqpuoqvx [email protected] 2001-02-03 04:05:07.000 +07:00 cd1e144d | ||
@ sqpuoqvx [email protected] 2001-02-03 08:05:07 cd1e144d | ||
│ (no description set) | ||
│ A new-staged-file | ||
│ M some-file | ||
│ A unstaged-file | ||
◉ mwrttmos [email protected] 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a | ||
◉ mwrttmos [email protected] 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a | ||
│ My commit message | ||
│ A some-file | ||
◉ zzzzzzzz root() 00000000 | ||
|
@@ -530,7 +530,7 @@ fn test_git_init_external_but_git_dir_exists() { | |
test_env.jj_cmd_ok(&workspace_root, &["new"]); | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "@-"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ qpvuntsm [email protected] 2001-02-03 04:05:07.000 +07:00 230dd059 | ||
◉ qpvuntsm [email protected] 2001-02-03 08:05:07 230dd059 | ||
│ (empty) (no description set) | ||
~ | ||
"###); | ||
|
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 |
---|---|---|
|
@@ -378,11 +378,11 @@ fn test_git_push_multiple() { | |
"###); | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-rall()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
@ yqosqzyt [email protected] 2001-02-03 04:05:17.000 +07:00 branch2 my-branch 15dcdaa4 | ||
@ yqosqzyt [email protected] 2001-02-03 08:05:17 branch2 my-branch 15dcdaa4 | ||
│ (empty) foo | ||
│ ◉ rlzusymt [email protected] 2001-02-03 04:05:10.000 +07:00 8476341e | ||
│ ◉ rlzusymt [email protected] 2001-02-03 08:05:10 8476341e | ||
├─╯ (empty) description 2 | ||
│ ◉ lzmmnrxq [email protected] 2001-02-03 04:05:08.000 +07:00 45a3aa29 | ||
│ ◉ lzmmnrxq [email protected] 2001-02-03 08:05:08 45a3aa29 | ||
├─╯ (empty) description 1 | ||
◉ zzzzzzzz root() 00000000 | ||
"###); | ||
|
@@ -670,11 +670,11 @@ fn test_git_push_deleted() { | |
"###); | ||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-rall()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ rlzusymt [email protected] 2001-02-03 04:05:10.000 +07:00 branch2 8476341e | ||
◉ rlzusymt [email protected] 2001-02-03 08:05:10 branch2 8476341e | ||
│ (empty) description 2 | ||
│ ◉ lzmmnrxq [email protected] 2001-02-03 04:05:08.000 +07:00 45a3aa29 | ||
│ ◉ lzmmnrxq [email protected] 2001-02-03 08:05:08 45a3aa29 | ||
├─╯ (empty) description 1 | ||
│ @ yqosqzyt [email protected] 2001-02-03 04:05:13.000 +07:00 5b36783c | ||
│ @ yqosqzyt [email protected] 2001-02-03 08:05:13 5b36783c | ||
├─╯ (empty) (no description set) | ||
◉ zzzzzzzz root() 00000000 | ||
"###); | ||
|
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 |
---|---|---|
|
@@ -92,12 +92,12 @@ fn test_no_subcommand() { | |
test_env.jj_cmd_ok(&repo_path, &["branch", "create", "show"]); | ||
// TODO: test_env.jj_cmd_ok(&repo_path, &["-r", "help"]) | ||
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["-r", "log"]), @r###" | ||
@ qpvuntsm [email protected] 2001-02-03 04:05:07.000 +07:00 help log show 230dd059 | ||
@ qpvuntsm [email protected] 2001-02-03 08:05:07 help log show 230dd059 | ||
│ (empty) (no description set) | ||
~ | ||
"###); | ||
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["-r", "show"]), @r###" | ||
@ qpvuntsm [email protected] 2001-02-03 04:05:07.000 +07:00 help log show 230dd059 | ||
@ qpvuntsm [email protected] 2001-02-03 08:05:07 help log show 230dd059 | ||
│ (empty) (no description set) | ||
~ | ||
"###); | ||
|
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 |
---|---|---|
|
@@ -28,11 +28,11 @@ fn test_rewrite_immutable_generic() { | |
std::fs::write(repo_path.join("file"), "c").unwrap(); | ||
let stdout = test_env.jj_cmd_success(&repo_path, &["log"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
@ mzvwutvl [email protected] 2001-02-03 04:05:12.000 +07:00 78ebd449 | ||
@ mzvwutvl [email protected] 2001-02-03 08:05:12 78ebd449 | ||
│ c | ||
│ ◉ kkmpptxz [email protected] 2001-02-03 04:05:10.000 +07:00 main c8d4c7ca | ||
│ ◉ kkmpptxz [email protected] 2001-02-03 08:05:10 main c8d4c7ca | ||
├─╯ b | ||
◉ qpvuntsm [email protected] 2001-02-03 04:05:08.000 +07:00 46a8dc51 | ||
◉ qpvuntsm [email protected] 2001-02-03 08:05:08 46a8dc51 | ||
│ a | ||
◉ zzzzzzzz root() 00000000 | ||
"###); | ||
|
@@ -97,14 +97,14 @@ fn test_rewrite_immutable_commands() { | |
// Log shows mutable commits and immutable heads by default | ||
let stdout = test_env.jj_cmd_success(&repo_path, &["log"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
@ yqosqzyt [email protected] 2001-02-03 04:05:13.000 +07:00 3f89addf | ||
@ yqosqzyt [email protected] 2001-02-03 08:05:13 3f89addf | ||
│ (empty) (no description set) | ||
│ ◉ mzvwutvl [email protected] 2001-02-03 04:05:11.000 +07:00 main 16ca9d80 conflict | ||
│ ◉ mzvwutvl [email protected] 2001-02-03 08:05:11 main 16ca9d80 conflict | ||
╭─┤ (empty) merge | ||
│ │ | ||
│ ~ | ||
│ | ||
◉ kkmpptxz [email protected] 2001-02-03 04:05:10.000 +07:00 c8d4c7ca | ||
◉ kkmpptxz [email protected] 2001-02-03 08:05:10 c8d4c7ca | ||
│ b | ||
~ | ||
"###); | ||
|
Oops, something went wrong.