diff --git a/CHANGELOG.md b/CHANGELOG.md index ac78133347..857c9cd0ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * In the templating language, Timestamps now have a `.local()` method for converting to the local timezone. +* Timestamps are now shown in local timezone and without milliseconds and + timezone offset by default. + * `jj next/prev` now infer `--edit` when you're already editing a non-head commit (a commit with children). diff --git a/cli/src/config/templates.toml b/cli/src/config/templates.toml index a2b66c6e8f..73ceddde52 100644 --- a/cli/src/config/templates.toml +++ b/cli/src/config/templates.toml @@ -143,7 +143,7 @@ commit_summary_separator = 'label("separator", " | ")' ++ " (" ++ format_timestamp(signature.timestamp()) ++ ")"''' 'format_time_range(time_range)' = ''' time_range.start().ago() ++ label("time", ", lasted ") ++ time_range.duration()''' -'format_timestamp(timestamp)' = 'timestamp' +'format_timestamp(timestamp)' = 'timestamp.local().format("%Y-%m-%d %H:%M:%S")' # We have "hidden" override "divergent", since a hidden revision does not cause # change id conflicts and is not affected by such conflicts; you have to use the diff --git a/cli/tests/common/mod.rs b/cli/tests/common/mod.rs index 6197fae504..3d3409adfb 100644 --- a/cli/tests/common/mod.rs +++ b/cli/tests/common/mod.rs @@ -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", "test.user@example.com"); diff --git a/cli/tests/test_abandon_command.rs b/cli/tests/test_abandon_command.rs index 05fe7855e1..883e5b30b3 100644 --- a/cli/tests/test_abandon_command.rs +++ b/cli/tests/test_abandon_command.rs @@ -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 test.user@example.com 2001-02-03 04:05:09.000 +07:00 a 2443ea76 + rlvkpnrz test.user@example.com 2001-02-03 08:05:09 a 2443ea76 a "###); diff --git a/cli/tests/test_builtin_aliases.rs b/cli/tests/test_builtin_aliases.rs index b8c1c84776..ce12878967 100644 --- a/cli/tests/test_builtin_aliases.rs +++ b/cli/tests/test_builtin_aliases.rs @@ -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 test.user@example.com 2001-02-03 04:05:08.000 +07:00 main 45a3aa29 + ◉ lzmmnrxq test.user@example.com 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 test.user@example.com 2001-02-03 04:05:08.000 +07:00 master 45a3aa29 + ◉ lzmmnrxq test.user@example.com 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 test.user@example.com 2001-02-03 04:05:08.000 +07:00 trunk 45a3aa29 + ◉ lzmmnrxq test.user@example.com 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 test.user@example.com 2001-02-03 04:05:08.000 +07:00 main 45a3aa29 + ◉ lzmmnrxq test.user@example.com 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 test.user@example.com 2001-02-03 04:05:08.000 +07:00 override-trunk 45a3aa29 + ◉ lzmmnrxq test.user@example.com 2001-02-03 08:05:08 override-trunk 45a3aa29 │ (empty) description 1 ~ "###); diff --git a/cli/tests/test_commit_template.rs b/cli/tests/test_commit_template.rs index 13eda0c4fa..36c8b2388d 100644 --- a/cli/tests/test_commit_template.rs +++ b/cli/tests/test_commit_template.rs @@ -132,14 +132,14 @@ fn test_log_author_timestamp_local() { test_env.add_env_var("TZ", "UTC-05:30"); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "author.timestamp().local()"]); insta::assert_snapshot!(stdout, @r###" - @ 2001-02-03 02:35:07.000 +05:30 - ◉ 1970-01-01 05:30:00.000 +05:30 + @ 2001-02-03 08:05:07.000 +11:00 + ◉ 1970-01-01 11:00:00.000 +11:00 "###); test_env.add_env_var("TZ", "UTC+10:00"); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "author.timestamp().local()"]); insta::assert_snapshot!(stdout, @r###" - @ 2001-02-02 11:05:07.000 -10:00 - ◉ 1969-12-31 14:00:00.000 -10:00 + @ 2001-02-03 08:05:07.000 +11:00 + ◉ 1970-01-01 11:00:00.000 +11:00 "###); } @@ -157,9 +157,9 @@ fn test_log_default() { // Test default log output format let stdout = test_env.jj_cmd_success(&repo_path, &["log"]); insta::assert_snapshot!(stdout, @r###" - @ kkmpptxz test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178 + @ kkmpptxz test.user@example.com 2001-02-03 08:05:09 my-branch 9de54178 │ (empty) description 1 - ◉ qpvuntsm test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264 + ◉ qpvuntsm test.user@example.com 2001-02-03 08:05:08 4291e264 │ add a file ◉ zzzzzzzz root() 00000000 "###); @@ -167,9 +167,9 @@ fn test_log_default() { // Color let stdout = test_env.jj_cmd_success(&repo_path, &["log", "--color=always"]); insta::assert_snapshot!(stdout, @r###" - @ kkmpptxz test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178 + @ kkmpptxz test.user@example.com 2001-02-03 08:05:09 my-branch 9de54178 │ (empty) description 1 - ◉ qpvuntsm test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264 + ◉ qpvuntsm test.user@example.com 2001-02-03 08:05:08 4291e264 │ add a file ◉ zzzzzzzz root() 00000000 "###); @@ -177,9 +177,9 @@ fn test_log_default() { // Color without graph let stdout = test_env.jj_cmd_success(&repo_path, &["log", "--color=always", "--no-graph"]); insta::assert_snapshot!(stdout, @r###" - kkmpptxz test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178 + kkmpptxz test.user@example.com 2001-02-03 08:05:09 my-branch 9de54178 (empty) description 1 - qpvuntsm test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264 + qpvuntsm test.user@example.com 2001-02-03 08:05:08 4291e264 add a file zzzzzzzz root() 00000000 "###); @@ -203,24 +203,24 @@ fn test_log_builtin_templates() { test_env.jj_cmd_ok(&repo_path, &["branch", "create", "my-branch"]); insta::assert_snapshot!(render(r#"builtin_log_oneline"#), @r###" - @ rlvkpnrz (no email set) 2001-02-03 04:05:08.000 +07:00 my-branch dc315397 (empty) (no description set) - ◉ qpvuntsm test.user 2001-02-03 04:05:07.000 +07:00 230dd059 (empty) (no description set) + @ rlvkpnrz (no email set) 2001-02-03 08:05:08 my-branch dc315397 (empty) (no description set) + ◉ qpvuntsm test.user 2001-02-03 08:05:07 230dd059 (empty) (no description set) ◉ zzzzzzzz root() 00000000 "###); insta::assert_snapshot!(render(r#"builtin_log_compact"#), @r###" - @ rlvkpnrz (no email set) 2001-02-03 04:05:08.000 +07:00 my-branch dc315397 + @ rlvkpnrz (no email set) 2001-02-03 08:05:08 my-branch dc315397 │ (empty) (no description set) - ◉ qpvuntsm test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059 + ◉ qpvuntsm test.user@example.com 2001-02-03 08:05:07 230dd059 │ (empty) (no description set) ◉ zzzzzzzz root() 00000000 "###); insta::assert_snapshot!(render(r#"builtin_log_comfortable"#), @r###" - @ rlvkpnrz (no email set) 2001-02-03 04:05:08.000 +07:00 my-branch dc315397 + @ rlvkpnrz (no email set) 2001-02-03 08:05:08 my-branch dc315397 │ (empty) (no description set) │ - ◉ qpvuntsm test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059 + ◉ qpvuntsm test.user@example.com 2001-02-03 08:05:07 230dd059 │ (empty) (no description set) │ ◉ zzzzzzzz root() 00000000 @@ -230,22 +230,22 @@ fn test_log_builtin_templates() { @ Commit ID: dc31539712c7294d1d712cec63cef4504b94ca74 │ Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp │ Branches: my-branch - │ Author: (no name set) <(no email set)> (2001-02-03 04:05:08.000 +07:00) - │ Committer: (no name set) <(no email set)> (2001-02-03 04:05:08.000 +07:00) + │ Author: (no name set) <(no email set)> (2001-02-03 08:05:08) + │ Committer: (no name set) <(no email set)> (2001-02-03 08:05:08) │ │ (no description set) │ ◉ Commit ID: 230dd059e1b059aefc0da06a2e5a7dbf22362f22 │ Change ID: qpvuntsmwlqtpsluzzsnyyzlmlwvmlnu - │ Author: Test User (2001-02-03 04:05:07.000 +07:00) - │ Committer: Test User (2001-02-03 04:05:07.000 +07:00) + │ Author: Test User (2001-02-03 08:05:07) + │ Committer: Test User (2001-02-03 08:05:07) │ │ (no description set) │ ◉ Commit ID: 0000000000000000000000000000000000000000 Change ID: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz - Author: (no name set) <(no email set)> (1970-01-01 00:00:00.000 +00:00) - Committer: (no name set) <(no email set)> (1970-01-01 00:00:00.000 +00:00) + Author: (no name set) <(no email set)> (1970-01-01 11:00:00) + Committer: (no name set) <(no email set)> (1970-01-01 11:00:00) (no description set) @@ -271,24 +271,24 @@ fn test_log_builtin_templates_colored() { test_env.jj_cmd_ok(&repo_path, &["branch", "create", "my-branch"]); insta::assert_snapshot!(render(r#"builtin_log_oneline"#), @r###" - @ rlvkpnrz (no email set) 2001-02-03 04:05:08.000 +07:00 my-branch dc315397 (empty) (no description set) - ◉ qpvuntsm test.user 2001-02-03 04:05:07.000 +07:00 230dd059 (empty) (no description set) + @ rlvkpnrz (no email set) 2001-02-03 08:05:08 my-branch dc315397 (empty) (no description set) + ◉ qpvuntsm test.user 2001-02-03 08:05:07 230dd059 (empty) (no description set) ◉ zzzzzzzz root() 00000000 "###); insta::assert_snapshot!(render(r#"builtin_log_compact"#), @r###" - @ rlvkpnrz (no email set) 2001-02-03 04:05:08.000 +07:00 my-branch dc315397 + @ rlvkpnrz (no email set) 2001-02-03 08:05:08 my-branch dc315397 │ (empty) (no description set) - ◉ qpvuntsm test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059 + ◉ qpvuntsm test.user@example.com 2001-02-03 08:05:07 230dd059 │ (empty) (no description set) ◉ zzzzzzzz root() 00000000 "###); insta::assert_snapshot!(render(r#"builtin_log_comfortable"#), @r###" - @ rlvkpnrz (no email set) 2001-02-03 04:05:08.000 +07:00 my-branch dc315397 + @ rlvkpnrz (no email set) 2001-02-03 08:05:08 my-branch dc315397 │ (empty) (no description set) │ - ◉ qpvuntsm test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059 + ◉ qpvuntsm test.user@example.com 2001-02-03 08:05:07 230dd059 │ (empty) (no description set) │ ◉ zzzzzzzz root() 00000000 @@ -298,22 +298,22 @@ fn test_log_builtin_templates_colored() { @ Commit ID: dc31539712c7294d1d712cec63cef4504b94ca74 │ Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp │ Branches: my-branch - │ Author: (no name set) <(no email set)> (2001-02-03 04:05:08.000 +07:00) - │ Committer: (no name set) <(no email set)> (2001-02-03 04:05:08.000 +07:00) + │ Author: (no name set) <(no email set)> (2001-02-03 08:05:08) + │ Committer: (no name set) <(no email set)> (2001-02-03 08:05:08) │ │  (no description set) │ ◉ Commit ID: 230dd059e1b059aefc0da06a2e5a7dbf22362f22 │ Change ID: qpvuntsmwlqtpsluzzsnyyzlmlwvmlnu - │ Author: Test User <test.user@example.com> (2001-02-03 04:05:07.000 +07:00) - │ Committer: Test User <test.user@example.com> (2001-02-03 04:05:07.000 +07:00) + │ Author: Test User <test.user@example.com> (2001-02-03 08:05:07) + │ Committer: Test User <test.user@example.com> (2001-02-03 08:05:07) │ │  (no description set) │ ◉ Commit ID: 0000000000000000000000000000000000000000 Change ID: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz - Author: (no name set) <(no email set)> (1970-01-01 00:00:00.000 +00:00) - Committer: (no name set) <(no email set)> (1970-01-01 00:00:00.000 +00:00) + Author: (no name set) <(no email set)> (1970-01-01 11:00:00) + Committer: (no name set) <(no email set)> (1970-01-01 11:00:00)  (no description set) @@ -331,7 +331,7 @@ fn test_log_obslog_divergence() { let stdout = test_env.jj_cmd_success(&repo_path, &["log"]); // No divergence insta::assert_snapshot!(stdout, @r###" - @ qpvuntsm test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e + @ qpvuntsm test.user@example.com 2001-02-03 08:05:08 7a17d52e │ description 1 ◉ zzzzzzzz root() 00000000 "###); @@ -343,9 +343,9 @@ fn test_log_obslog_divergence() { ); let (stdout, stderr) = test_env.jj_cmd_ok(&repo_path, &["log"]); insta::assert_snapshot!(stdout, @r###" - ◉ qpvuntsm?? test.user@example.com 2001-02-03 04:05:10.000 +07:00 8979953d + ◉ qpvuntsm?? test.user@example.com 2001-02-03 08:05:10 8979953d │ description 2 - │ @ qpvuntsm?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e + │ @ qpvuntsm?? test.user@example.com 2001-02-03 08:05:08 7a17d52e ├─╯ description 1 ◉ zzzzzzzz root() 00000000 "###); @@ -356,9 +356,9 @@ fn test_log_obslog_divergence() { // Color let stdout = test_env.jj_cmd_success(&repo_path, &["log", "--color=always"]); insta::assert_snapshot!(stdout, @r###" - ◉ qpvuntsm?? test.user@example.com 2001-02-03 04:05:10.000 +07:00 8979953d + ◉ qpvuntsm?? test.user@example.com 2001-02-03 08:05:10 8979953d │ description 2 - │ @ qpvuntsm?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e + │ @ qpvuntsm?? test.user@example.com 2001-02-03 08:05:08 7a17d52e ├─╯ description 1 ◉ zzzzzzzz root() 00000000 "###); @@ -366,22 +366,22 @@ fn test_log_obslog_divergence() { // Obslog and hidden divergent let stdout = test_env.jj_cmd_success(&repo_path, &["obslog"]); insta::assert_snapshot!(stdout, @r###" - @ qpvuntsm?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e + @ qpvuntsm?? test.user@example.com 2001-02-03 08:05:08 7a17d52e │ description 1 - ◉ qpvuntsm hidden test.user@example.com 2001-02-03 04:05:08.000 +07:00 3b68ce25 + ◉ qpvuntsm hidden test.user@example.com 2001-02-03 08:05:08 3b68ce25 │ (no description set) - ◉ qpvuntsm hidden test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059 + ◉ qpvuntsm hidden test.user@example.com 2001-02-03 08:05:07 230dd059 (empty) (no description set) "###); // Colored obslog let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "--color=always"]); insta::assert_snapshot!(stdout, @r###" - @ qpvuntsm?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e + @ qpvuntsm?? test.user@example.com 2001-02-03 08:05:08 7a17d52e │ description 1 - ◉ qpvuntsm hidden test.user@example.com 2001-02-03 04:05:08.000 +07:00 3b68ce25 + ◉ qpvuntsm hidden test.user@example.com 2001-02-03 08:05:08 3b68ce25 │ (no description set) - ◉ qpvuntsm hidden test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059 + ◉ qpvuntsm hidden test.user@example.com 2001-02-03 08:05:07 230dd059 (empty) (no description set) "###); } @@ -487,9 +487,9 @@ fn test_log_git_head() { std::fs::write(repo_path.join("file"), "foo\n").unwrap(); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "--color=always"]); insta::assert_snapshot!(stdout, @r###" - @ rlvkpnrz test.user@example.com 2001-02-03 04:05:09.000 +07:00 50aaf475 + @ rlvkpnrz test.user@example.com 2001-02-03 08:05:09 50aaf475 │ initial - ◉ qpvuntsm test.user@example.com 2001-02-03 04:05:07.000 +07:00 HEAD@git 230dd059 + ◉ qpvuntsm test.user@example.com 2001-02-03 08:05:07 HEAD@git 230dd059 │ (empty) (no description set) ◉ zzzzzzzz root() 00000000 "###); @@ -514,7 +514,7 @@ fn test_log_customize_short_id() { ], ); insta::assert_snapshot!(stdout, @r###" - @ Q_pvun test.user@example.com 2001-02-03 04:05:08.000 +07:00 6_9542 + @ Q_pvun test.user@example.com 2001-02-03 08:05:08 6_9542 │ (empty) first ◉ Z_zzzz root() 0_0000 "###); @@ -532,7 +532,7 @@ fn test_log_customize_short_id() { ], ); insta::assert_snapshot!(stdout, @r###" - @ QPVUNTSM test.user@example.com 2001-02-03 04:05:08.000 +07:00 69542c19 + @ QPVUNTSM test.user@example.com 2001-02-03 08:05:08 69542c19 │ (empty) first ◉ ZZZZZZZZ root() 00000000 "###); diff --git a/cli/tests/test_diff_command.rs b/cli/tests/test_diff_command.rs index e73ceccf4a..c59ed69255 100644 --- a/cli/tests/test_diff_command.rs +++ b/cli/tests/test_diff_command.rs @@ -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 test.user@example.com 2001-02-03 04:05:09.000 +07:00 0cba70c7 + @ rlvkpnrz test.user@example.com 2001-02-03 08:05:09 0cba70c7 │ (no description set) │ file1 │ file2 │ -- │ file2 │ file3 - ◉ qpvuntsm test.user@example.com 2001-02-03 04:05:08.000 +07:00 39b5a56f + ◉ qpvuntsm test.user@example.com 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 (2001-02-03 04:05:08.000 +07:00) - Committer: Test User (2001-02-03 04:05:09.000 +07:00) + Author: Test User (2001-02-03 08:05:08) + Committer: Test User (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 (2001-02-03 04:05:08.000 +07:00) - Committer: Test User (2001-02-03 04:05:09.000 +07:00) + Author: Test User (2001-02-03 08:05:08) + Committer: Test User (2001-02-03 08:05:09) (no description set) diff --git a/cli/tests/test_git_import_export.rs b/cli/tests/test_git_import_export.rs index f7a7ffb809..1193fb5a16 100644 --- a/cli/tests/test_git_import_export.rs +++ b/cli/tests/test_git_import_export.rs @@ -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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 a 230dd059 + @ qpvuntsm test.user@example.com 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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 a 230dd059 + @ qpvuntsm test.user@example.com 2001-02-03 08:05:07 a 230dd059 │ (empty) (no description set) ~ "###); diff --git a/cli/tests/test_git_init.rs b/cli/tests/test_git_init.rs index 6b587dcaa5..00e8407155 100644 --- a/cli/tests/test_git_init.rs +++ b/cli/tests/test_git_init.rs @@ -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 git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 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 git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd + ◉ sqpuoqvx test.user@example.com 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 git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd + ◉ sqpuoqvx test.user@example.com 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 git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd + ◉ sqpuoqvx test.user@example.com 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 git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd + ◉ sqpuoqvx test.user@example.com 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 git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd + ◉ sqpuoqvx test.user@example.com 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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 cd1e144d + @ sqpuoqvx test.user@example.com 2001-02-03 08:05:07 cd1e144d │ (no description set) │ A new-staged-file │ M some-file │ A unstaged-file - ◉ mwrttmos git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059 + ◉ qpvuntsm test.user@example.com 2001-02-03 08:05:07 230dd059 │ (empty) (no description set) ~ "###); diff --git a/cli/tests/test_git_push.rs b/cli/tests/test_git_push.rs index 8fedaf6a44..c1919cc01c 100644 --- a/cli/tests/test_git_push.rs +++ b/cli/tests/test_git_push.rs @@ -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 test.user@example.com 2001-02-03 04:05:17.000 +07:00 branch2 my-branch 15dcdaa4 + @ yqosqzyt test.user@example.com 2001-02-03 08:05:17 branch2 my-branch 15dcdaa4 │ (empty) foo - │ ◉ rlzusymt test.user@example.com 2001-02-03 04:05:10.000 +07:00 8476341e + │ ◉ rlzusymt test.user@example.com 2001-02-03 08:05:10 8476341e ├─╯ (empty) description 2 - │ ◉ lzmmnrxq test.user@example.com 2001-02-03 04:05:08.000 +07:00 45a3aa29 + │ ◉ lzmmnrxq test.user@example.com 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 test.user@example.com 2001-02-03 04:05:10.000 +07:00 branch2 8476341e + ◉ rlzusymt test.user@example.com 2001-02-03 08:05:10 branch2 8476341e │ (empty) description 2 - │ ◉ lzmmnrxq test.user@example.com 2001-02-03 04:05:08.000 +07:00 45a3aa29 + │ ◉ lzmmnrxq test.user@example.com 2001-02-03 08:05:08 45a3aa29 ├─╯ (empty) description 1 - │ @ yqosqzyt test.user@example.com 2001-02-03 04:05:13.000 +07:00 5b36783c + │ @ yqosqzyt test.user@example.com 2001-02-03 08:05:13 5b36783c ├─╯ (empty) (no description set) ◉ zzzzzzzz root() 00000000 "###); diff --git a/cli/tests/test_global_opts.rs b/cli/tests/test_global_opts.rs index f6bafbc4df..9a987252b0 100644 --- a/cli/tests/test_global_opts.rs +++ b/cli/tests/test_global_opts.rs @@ -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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 help log show 230dd059 + @ qpvuntsm test.user@example.com 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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 help log show 230dd059 + @ qpvuntsm test.user@example.com 2001-02-03 08:05:07 help log show 230dd059 │ (empty) (no description set) ~ "###); diff --git a/cli/tests/test_immutable_commits.rs b/cli/tests/test_immutable_commits.rs index 66dfb0e7d8..c122f85d8d 100644 --- a/cli/tests/test_immutable_commits.rs +++ b/cli/tests/test_immutable_commits.rs @@ -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 test.user@example.com 2001-02-03 04:05:12.000 +07:00 78ebd449 + @ mzvwutvl test.user@example.com 2001-02-03 08:05:12 78ebd449 │ c - │ ◉ kkmpptxz test.user@example.com 2001-02-03 04:05:10.000 +07:00 main c8d4c7ca + │ ◉ kkmpptxz test.user@example.com 2001-02-03 08:05:10 main c8d4c7ca ├─╯ b - ◉ qpvuntsm test.user@example.com 2001-02-03 04:05:08.000 +07:00 46a8dc51 + ◉ qpvuntsm test.user@example.com 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 test.user@example.com 2001-02-03 04:05:13.000 +07:00 3f89addf + @ yqosqzyt test.user@example.com 2001-02-03 08:05:13 3f89addf │ (empty) (no description set) - │ ◉ mzvwutvl test.user@example.com 2001-02-03 04:05:11.000 +07:00 main 16ca9d80 conflict + │ ◉ mzvwutvl test.user@example.com 2001-02-03 08:05:11 main 16ca9d80 conflict ╭─┤ (empty) merge │ │ │ ~ │ - ◉ kkmpptxz test.user@example.com 2001-02-03 04:05:10.000 +07:00 c8d4c7ca + ◉ kkmpptxz test.user@example.com 2001-02-03 08:05:10 c8d4c7ca │ b ~ "###); diff --git a/cli/tests/test_init_command.rs b/cli/tests/test_init_command.rs index fd8921eb00..3b0c4d7e91 100644 --- a/cli/tests/test_init_command.rs +++ b/cli/tests/test_init_command.rs @@ -139,7 +139,7 @@ fn test_init_git_external(bare: bool) { let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "@-"]); insta::allow_duplicates! { insta::assert_snapshot!(stdout, @r###" - ◉ mwrttmos git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a │ My commit message ~ "###); @@ -205,7 +205,7 @@ fn test_init_git_colocated() { // 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 git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a │ My commit message ~ "###); @@ -214,7 +214,7 @@ fn test_init_git_colocated() { 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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd + ◉ sqpuoqvx test.user@example.com 2001-02-03 08:05:07 HEAD@git f61b77cd │ (no description set) ~ "###); @@ -244,7 +244,7 @@ fn test_init_git_colocated_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 git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a │ My commit message ~ "###); @@ -253,7 +253,7 @@ fn test_init_git_colocated_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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd + ◉ sqpuoqvx test.user@example.com 2001-02-03 08:05:07 HEAD@git f61b77cd │ (no description set) ~ "###); @@ -282,7 +282,7 @@ fn test_init_git_colocated_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 git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a │ My commit message ~ "###); @@ -291,7 +291,7 @@ fn test_init_git_colocated_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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd + ◉ sqpuoqvx test.user@example.com 2001-02-03 08:05:07 HEAD@git f61b77cd │ (no description set) ~ "###); @@ -323,7 +323,7 @@ fn test_init_git_colocated_symlink_directory_without_bare_config() { // 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 git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a │ My commit message ~ "###); @@ -332,7 +332,7 @@ fn test_init_git_colocated_symlink_directory_without_bare_config() { 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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd + ◉ sqpuoqvx test.user@example.com 2001-02-03 08:05:07 HEAD@git f61b77cd │ (no description set) ~ "###); @@ -366,7 +366,7 @@ fn test_init_git_colocated_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 git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a + ◉ mwrttmos git.user@example.com 1970-01-01 11:02:03 my-branch HEAD@git 8d698d4a │ My commit message ~ "###); @@ -375,7 +375,7 @@ fn test_init_git_colocated_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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 HEAD@git f61b77cd + ◉ sqpuoqvx test.user@example.com 2001-02-03 08:05:07 HEAD@git f61b77cd │ (no description set) ~ "###); @@ -482,7 +482,7 @@ fn test_init_git_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 test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059 + ◉ qpvuntsm test.user@example.com 2001-02-03 08:05:07 230dd059 │ (empty) (no description set) ~ "###); diff --git a/cli/tests/test_log_command.rs b/cli/tests/test_log_command.rs index 1dd598e9d3..1530bdd73f 100644 --- a/cli/tests/test_log_command.rs +++ b/cli/tests/test_log_command.rs @@ -666,7 +666,7 @@ fn test_log_author_format() { insta::assert_snapshot!( test_env.jj_cmd_success(&repo_path, &["log", "--revisions=@"]), @r###" - @ qpvuntsm test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059 + @ qpvuntsm test.user@example.com 2001-02-03 08:05:07 230dd059 │ (empty) (no description set) ~ "### @@ -684,7 +684,7 @@ fn test_log_author_format() { ], ), @r###" - @ qpvuntsm test.user 2001-02-03 04:05:07.000 +07:00 230dd059 + @ qpvuntsm test.user 2001-02-03 08:05:07 230dd059 │ (empty) (no description set) ~ "### @@ -1213,32 +1213,30 @@ fn test_log_word_wrap() { // ui.log-word-wrap option applies to both graph/no-graph outputs insta::assert_snapshot!(render(&["log", "-r@"], 40, false), @r###" - @ mzvwutvl test.user@example.com 2001-02-03 04:05:11.000 +07:00 68518a7e + @ mzvwutvl test.user@example.com 2001-02-03 08:05:11 68518a7e │ (empty) merge ~ "###); insta::assert_snapshot!(render(&["log", "-r@"], 40, true), @r###" @ mzvwutvl test.user@example.com - │ 2001-02-03 04:05:11.000 +07:00 - ~ 68518a7e - (empty) merge + │ 2001-02-03 08:05:11 68518a7e + ~ (empty) merge "###); insta::assert_snapshot!(render(&["log", "--no-graph", "-r@"], 40, false), @r###" - mzvwutvl test.user@example.com 2001-02-03 04:05:11.000 +07:00 68518a7e + mzvwutvl test.user@example.com 2001-02-03 08:05:11 68518a7e (empty) merge "###); insta::assert_snapshot!(render(&["log", "--no-graph", "-r@"], 40, true), @r###" mzvwutvl test.user@example.com - 2001-02-03 04:05:11.000 +07:00 68518a7e + 2001-02-03 08:05:11 68518a7e (empty) merge "###); // Color labels should be preserved insta::assert_snapshot!(render(&["log", "-r@", "--color=always"], 40, true), @r###" @ mzvwutvl test.user@example.com - │ 2001-02-03 04:05:11.000 +07:00 - ~ 68518a7e - (empty) merge + │ 2001-02-03 08:05:11 68518a7e + ~ (empty) merge "###); // Graph width should be subtracted from the term width @@ -1269,8 +1267,7 @@ fn test_log_word_wrap() { @ mzvwutvl │ test.user@example.com ~ 2001-02-03 - 04:05:11.000 - +07:00 + 08:05:11 68518a7e (empty) merge @@ -1279,8 +1276,7 @@ fn test_log_word_wrap() { @ mzvwutvl │ test.user@example.com ~ 2001-02-03 - 04:05:11.000 - +07:00 + 08:05:11 68518a7e (empty) merge diff --git a/cli/tests/test_obslog_command.rs b/cli/tests/test_obslog_command.rs index 296918b055..1f81e93911 100644 --- a/cli/tests/test_obslog_command.rs +++ b/cli/tests/test_obslog_command.rs @@ -29,26 +29,26 @@ fn test_obslog_with_or_without_diff() { let stdout = test_env.jj_cmd_success(&repo_path, &["obslog"]); insta::assert_snapshot!(stdout, @r###" - @ rlvkpnrz test.user@example.com 2001-02-03 04:05:10.000 +07:00 66b42ad3 + @ rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3 │ my description - ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 5f4634a5 conflict + ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:09 5f4634a5 conflict │ my description - ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bc + ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:09 6fbba7bc │ my description - ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0da + ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:08 eac0d0da (empty) my description "###); // Color let stdout = test_env.jj_cmd_success(&repo_path, &["--color=always", "obslog"]); insta::assert_snapshot!(stdout, @r###" - @ rlvkpnrz test.user@example.com 2001-02-03 04:05:10.000 +07:00 66b42ad3 + @ rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3 │ my description - ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 5f4634a5 conflict + ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:09 5f4634a5 conflict │ my description - ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bc + ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:09 6fbba7bc │ my description - ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0da + ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:08 eac0d0da (empty) my description "###); @@ -56,7 +56,7 @@ fn test_obslog_with_or_without_diff() { // (even even though it resulted in a conflict). let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "-p"]); insta::assert_snapshot!(stdout, @r###" - @ rlvkpnrz test.user@example.com 2001-02-03 04:05:10.000 +07:00 66b42ad3 + @ rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3 │ my description │ Resolved conflict in file1: │ 1 1: <<<<<<>>>>>> - ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 5f4634a5 conflict + ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:09 5f4634a5 conflict │ my description - ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bc + ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:09 6fbba7bc │ my description │ Modified regular file file1: │ 1 1: foo │ 2: bar │ Added regular file file2: │ 1: foo - ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0da + ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:08 eac0d0da (empty) my description "###); // Test `--limit` let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "--limit=2"]); insta::assert_snapshot!(stdout, @r###" - @ rlvkpnrz test.user@example.com 2001-02-03 04:05:10.000 +07:00 66b42ad3 + @ rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3 │ my description - ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 5f4634a5 conflict + ◉ rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:09 5f4634a5 conflict │ my description "###); // Test `--no-graph` let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "--no-graph"]); insta::assert_snapshot!(stdout, @r###" - rlvkpnrz test.user@example.com 2001-02-03 04:05:10.000 +07:00 66b42ad3 + rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3 my description - rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 5f4634a5 conflict + rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:09 5f4634a5 conflict my description - rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bc + rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:09 6fbba7bc my description - rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0da + rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:08 eac0d0da (empty) my description "###); // Test `--git` format, and that it implies `-p` let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "--no-graph", "--git"]); insta::assert_snapshot!(stdout, @r###" - rlvkpnrz test.user@example.com 2001-02-03 04:05:10.000 +07:00 66b42ad3 + rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3 my description diff --git a/file1 b/file1 index 0000000000...2ab19ae607 100644 @@ -119,9 +119,9 @@ fn test_obslog_with_or_without_diff() { -bar ->>>>>>> +resolved - rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 5f4634a5 conflict + rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:09 5f4634a5 conflict my description - rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bc + rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:09 6fbba7bc my description diff --git a/file1 b/file1 index 257cc5642c...3bd1f0e297 100644 @@ -137,7 +137,7 @@ fn test_obslog_with_or_without_diff() { +++ b/file2 @@ -1,0 +1,1 @@ +foo - rlvkpnrz hidden test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0da + rlvkpnrz hidden test.user@example.com 2001-02-03 08:05:08 eac0d0da (empty) my description "###); } @@ -165,33 +165,31 @@ fn test_obslog_word_wrap() { // ui.log-word-wrap option applies to both graph/no-graph outputs insta::assert_snapshot!(render(&["obslog"], 40, false), @r###" - @ qpvuntsm test.user@example.com 2001-02-03 04:05:08.000 +07:00 69542c19 + @ qpvuntsm test.user@example.com 2001-02-03 08:05:08 69542c19 │ (empty) first - ◉ qpvuntsm hidden test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059 + ◉ qpvuntsm hidden test.user@example.com 2001-02-03 08:05:07 230dd059 (empty) (no description set) "###); insta::assert_snapshot!(render(&["obslog"], 40, true), @r###" @ qpvuntsm test.user@example.com - │ 2001-02-03 04:05:08.000 +07:00 - │ 69542c19 + │ 2001-02-03 08:05:08 69542c19 │ (empty) first ◉ qpvuntsm hidden test.user@example.com - 2001-02-03 04:05:07.000 +07:00 - 230dd059 + 2001-02-03 08:05:07 230dd059 (empty) (no description set) "###); insta::assert_snapshot!(render(&["obslog", "--no-graph"], 40, false), @r###" - qpvuntsm test.user@example.com 2001-02-03 04:05:08.000 +07:00 69542c19 + qpvuntsm test.user@example.com 2001-02-03 08:05:08 69542c19 (empty) first - qpvuntsm hidden test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059 + qpvuntsm hidden test.user@example.com 2001-02-03 08:05:07 230dd059 (empty) (no description set) "###); insta::assert_snapshot!(render(&["obslog", "--no-graph"], 40, true), @r###" qpvuntsm test.user@example.com - 2001-02-03 04:05:08.000 +07:00 69542c19 + 2001-02-03 08:05:08 69542c19 (empty) first qpvuntsm hidden test.user@example.com - 2001-02-03 04:05:07.000 +07:00 230dd059 + 2001-02-03 08:05:07 230dd059 (empty) (no description set) "###); } @@ -213,25 +211,25 @@ fn test_obslog_squash() { let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "-p", "-r", "@-"]); insta::assert_snapshot!(stdout, @r###" - ◉ qpvuntsm test.user@example.com 2001-02-03 04:05:10.000 +07:00 27e721a5 + ◉ qpvuntsm test.user@example.com 2001-02-03 08:05:10 27e721a5 ├─╮ squashed │ │ Modified regular file file1: │ │ 1 1: foo │ │ 2: bar - ◉ │ qpvuntsm hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 9764e503 + ◉ │ qpvuntsm hidden test.user@example.com 2001-02-03 08:05:09 9764e503 │ │ first │ │ Added regular file file1: │ │ 1: foo - ◉ │ qpvuntsm hidden test.user@example.com 2001-02-03 04:05:08.000 +07:00 69542c19 + ◉ │ qpvuntsm hidden test.user@example.com 2001-02-03 08:05:08 69542c19 │ │ (empty) first - ◉ │ qpvuntsm hidden test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059 + ◉ │ qpvuntsm hidden test.user@example.com 2001-02-03 08:05:07 230dd059 │ (empty) (no description set) - ◉ kkmpptxz hidden test.user@example.com 2001-02-03 04:05:10.000 +07:00 f09a3889 + ◉ kkmpptxz hidden test.user@example.com 2001-02-03 08:05:10 f09a3889 │ second │ Modified regular file file1: │ 1 1: foo │ 2: bar - ◉ kkmpptxz hidden test.user@example.com 2001-02-03 04:05:09.000 +07:00 57996536 + ◉ kkmpptxz hidden test.user@example.com 2001-02-03 08:05:09 57996536 (empty) second "###); } diff --git a/cli/tests/test_show_command.rs b/cli/tests/test_show_command.rs index 8cee1a4be1..e5d116c5f9 100644 --- a/cli/tests/test_show_command.rs +++ b/cli/tests/test_show_command.rs @@ -27,8 +27,8 @@ fn test_show() { let stdout = stdout.lines().skip(2).join("\n"); insta::assert_snapshot!(stdout, @r###" - Author: Test User (2001-02-03 04:05:07.000 +07:00) - Committer: Test User (2001-02-03 04:05:07.000 +07:00) + Author: Test User (2001-02-03 08:05:07) + Committer: Test User (2001-02-03 08:05:07) (no description set) "###); diff --git a/cli/tests/test_tree_level_conflicts.rs b/cli/tests/test_tree_level_conflicts.rs index 8480a7099f..06739e041c 100644 --- a/cli/tests/test_tree_level_conflicts.rs +++ b/cli/tests/test_tree_level_conflicts.rs @@ -39,13 +39,13 @@ fn test_enable_tree_level_conflicts() { test_env.jj_cmd_ok(&repo_path, &["new"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log"]); insta::assert_snapshot!(stdout, @r###" - @ mzvwutvl test.user@example.com 2001-02-03 04:05:11.000 +07:00 f2101bed conflict + @ mzvwutvl test.user@example.com 2001-02-03 08:05:11 f2101bed conflict │ (empty) (no description set) - ◉ zsuskuln test.user@example.com 2001-02-03 04:05:10.000 +07:00 5100e4e1 conflict + ◉ zsuskuln test.user@example.com 2001-02-03 08:05:10 5100e4e1 conflict ├─╮ (empty) merge - │ ◉ kkmpptxz test.user@example.com 2001-02-03 04:05:10.000 +07:00 0b65c8fb + │ ◉ kkmpptxz test.user@example.com 2001-02-03 08:05:10 0b65c8fb │ │ right - ◉ │ rlvkpnrz test.user@example.com 2001-02-03 04:05:09.000 +07:00 32003b88 + ◉ │ rlvkpnrz test.user@example.com 2001-02-03 08:05:09 32003b88 ├─╯ left ◉ zzzzzzzz root() 00000000 "###); @@ -56,13 +56,13 @@ fn test_enable_tree_level_conflicts() { // non-empty let stdout = test_env.jj_cmd_success(&repo_path, &["log"]); insta::assert_snapshot!(stdout, @r###" - @ mzvwutvl test.user@example.com 2001-02-03 04:05:13.000 +07:00 54c562fa conflict + @ mzvwutvl test.user@example.com 2001-02-03 08:05:13 54c562fa conflict │ (no description set) - ◉ zsuskuln test.user@example.com 2001-02-03 04:05:10.000 +07:00 5100e4e1 conflict + ◉ zsuskuln test.user@example.com 2001-02-03 08:05:10 5100e4e1 conflict ├─╮ (empty) merge - │ ◉ kkmpptxz test.user@example.com 2001-02-03 04:05:10.000 +07:00 0b65c8fb + │ ◉ kkmpptxz test.user@example.com 2001-02-03 08:05:10 0b65c8fb │ │ right - ◉ │ rlvkpnrz test.user@example.com 2001-02-03 04:05:09.000 +07:00 32003b88 + ◉ │ rlvkpnrz test.user@example.com 2001-02-03 08:05:09 32003b88 ├─╯ left ◉ zzzzzzzz root() 00000000 "###); @@ -75,7 +75,7 @@ fn test_enable_tree_level_conflicts() { test_env.jj_cmd_ok(&repo_path, &["new", "k"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r=@"]); insta::assert_snapshot!(stdout, @r###" - @ yostqsxw test.user@example.com 2001-02-03 04:05:15.000 +07:00 112f0ac2 + @ yostqsxw test.user@example.com 2001-02-03 08:05:15 112f0ac2 │ (empty) (no description set) ~ "###); diff --git a/cli/tests/test_workspaces.rs b/cli/tests/test_workspaces.rs index c1dfb6f312..3849b64dcb 100644 --- a/cli/tests/test_workspaces.rs +++ b/cli/tests/test_workspaces.rs @@ -491,9 +491,9 @@ fn test_workspaces_current_op_discarded_by_other() { let (stdout, stderr) = test_env.jj_cmd_ok(&secondary_path, &["obslog"]); insta::assert_snapshot!(stderr, @""); insta::assert_snapshot!(stdout, @r###" - @ znkkpsqq test.user@example.com 2001-02-03 04:05:16.000 +07:00 secondary@ e5b7d155 + @ znkkpsqq test.user@example.com 2001-02-03 08:05:16 secondary@ e5b7d155 │ (no description set) - ◉ znkkpsqq hidden test.user@example.com 2001-02-03 04:05:16.000 +07:00 9d040f9a + ◉ znkkpsqq hidden test.user@example.com 2001-02-03 08:05:16 9d040f9a (empty) (no description set) "###); } diff --git a/docs/config.md b/docs/config.md index 04eeda5904..1a652354f3 100644 --- a/docs/config.md +++ b/docs/config.md @@ -269,7 +269,7 @@ Can be customized by the `format_timestamp()` template alias. ```toml [template-aliases] -# Full timestamp in ISO 8601 format (default) +# Full timestamp in ISO 8601 format 'format_timestamp(timestamp)' = 'timestamp' # Relative timestamp rendered as "x days/hours/seconds ago" 'format_timestamp(timestamp)' = 'timestamp.ago()'