templates: align attributes in builtin_log_detailed
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
nix / flake check (push) Waiting to run
build / build (, macos-13) (push) Waiting to run
build / build (, macos-14) (push) Waiting to run
build / build (, ubuntu-latest) (push) Waiting to run
build / build (, windows-latest) (push) Waiting to run
build / build (--all-features, ubuntu-latest) (push) Waiting to run
build / Build jj-lib without Git support (push) Waiting to run
build / Check protos (push) Waiting to run
build / Check formatting (push) Waiting to run
build / Check that MkDocs can build the docs (push) Waiting to run
build / Check that MkDocs can build the docs with latest Python and uv (push) Waiting to run
build / cargo-deny (advisories) (push) Waiting to run
build / cargo-deny (bans licenses sources) (push) Waiting to run
build / Clippy check (push) Waiting to run
Codespell / Codespell (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-latest) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run

Change-Id: Id00000003feb0508bf7f08e0a0275ba7f7695b70
This commit is contained in:
Vamsi Avula 2024-12-07 22:37:37 +05:30
parent 6c72a3d1c1
commit 0794f87324
5 changed files with 67 additions and 68 deletions

View file

@ -133,8 +133,8 @@ concat(
"Commit ID: " ++ commit_id ++ "\n",
"Change ID: " ++ change_id ++ "\n",
surround("Bookmarks: ", "\n", separate(" ", local_bookmarks, remote_bookmarks)),
surround("Tags: ", "\n", tags),
"Author: " ++ format_detailed_signature(author) ++ "\n",
surround("Tags : ", "\n", tags),
"Author : " ++ format_detailed_signature(author) ++ "\n",
"Committer: " ++ format_detailed_signature(committer) ++ "\n",
"\n",
indent(" ",

View file

@ -142,10 +142,10 @@ fn test_backout_multiple() {
"###);
// View the output of each backed out commit
let stdout = test_env.jj_cmd_success(&repo_path, &["show", "@+"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: 8ff3fbc2ccb0d66985f558c461d1643cebb4c7d6
Change ID: wqnwkozpkustnxypnnntnykwrqrkrpvv
Author: Test User <test.user@example.com> (2001-02-03 08:05:19)
Author : Test User <test.user@example.com> (2001-02-03 08:05:19)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:19)
Back out "e"
@ -156,12 +156,12 @@ fn test_backout_multiple() {
1 1: a
2 2: b
3 : c
"###);
"#);
let stdout = test_env.jj_cmd_success(&repo_path, &["show", "@++"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: d31d42e0267f6524d445348b1dd00926c62a6b57
Change ID: mouksmquosnpvwqrpsvvxtxpywpnxlss
Author: Test User <test.user@example.com> (2001-02-03 08:05:19)
Author : Test User <test.user@example.com> (2001-02-03 08:05:19)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:19)
Back out "c"
@ -170,12 +170,12 @@ fn test_backout_multiple() {
Removed regular file b:
1 : b
"###);
"#);
let stdout = test_env.jj_cmd_success(&repo_path, &["show", "@+++"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: 6504c4ded177fba2334f76683d1aa643700d5073
Change ID: tqvpomtpwrqsylrpsxknultrymmqxmxv
Author: Test User <test.user@example.com> (2001-02-03 08:05:19)
Author : Test User <test.user@example.com> (2001-02-03 08:05:19)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:19)
Back out "b"
@ -185,7 +185,7 @@ fn test_backout_multiple() {
Modified regular file a:
1 1: a
2 : b
"###);
"#);
}
fn get_log_output(test_env: &TestEnvironment, cwd: &Path) -> String {

View file

@ -316,31 +316,31 @@ fn test_log_builtin_templates() {
[EOF]
"###);
insta::assert_snapshot!(render(r#"builtin_log_detailed"#), @r###"
insta::assert_snapshot!(render(r#"builtin_log_detailed"#), @r#"
Commit ID: dc31539712c7294d1d712cec63cef4504b94ca74
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Bookmarks: my-bookmark
Author: (no name set) <(no email set)> (2001-02-03 08:05:08)
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 08:05:07)
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 11: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)
[EOF]
"###);
"#);
}
#[test]
@ -386,30 +386,29 @@ fn test_log_builtin_templates_colored() {
"#);
insta::assert_snapshot!(render(r#"builtin_log_detailed"#), @r###"
insta::assert_snapshot!(render(r#"builtin_log_detailed"#), @r#"
@ Commit ID: dc31539712c7294d1d712cec63cef4504b94ca74
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Bookmarks: my-bookmark
Author: (no name set) <(no email set)> (2001-02-03 08:05:08)
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 08:05:07)
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 11: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)
"###);
"#);
}
#[test]
@ -455,30 +454,30 @@ fn test_log_builtin_templates_colored_debug() {
<<log::>>
"#);
insta::assert_snapshot!(render(r#"builtin_log_detailed"#), @r###"
insta::assert_snapshot!(render(r#"builtin_log_detailed"#), @r#"
<<node working_copy::@>> <<log::Commit ID: >><<log commit_id::dc31539712c7294d1d712cec63cef4504b94ca74>><<log::>>
<<log::Change ID: >><<log change_id::rlvkpnrzqnoowoytxnquwvuryrwnrmlp>><<log::>>
<<log::Bookmarks: >><<log local_bookmarks name::my-bookmark>><<log::>>
<<log::Author: >><<log name placeholder::(no name set)>><<log:: <>><<log email placeholder::(no email set)>><<log::> (>><<log author timestamp local format::2001-02-03 08:05:08>><<log::)>>
<<log::Author : >><<log name placeholder::(no name set)>><<log:: <>><<log email placeholder::(no email set)>><<log::> (>><<log author timestamp local format::2001-02-03 08:05:08>><<log::)>>
<<log::Committer: >><<log name placeholder::(no name set)>><<log:: <>><<log email placeholder::(no email set)>><<log::> (>><<log committer timestamp local format::2001-02-03 08:05:08>><<log::)>>
<<log::>>
<<log empty description placeholder:: (no description set)>><<log::>>
<<log::>>
<<node::>> <<log::Commit ID: >><<log commit_id::230dd059e1b059aefc0da06a2e5a7dbf22362f22>><<log::>>
<<log::Change ID: >><<log change_id::qpvuntsmwlqtpsluzzsnyyzlmlwvmlnu>><<log::>>
<<log::Author: >><<log author name::Test User>><<log:: <>><<log author email::test.user@example.com>><<log::> (>><<log author timestamp local format::2001-02-03 08:05:07>><<log::)>>
<<log::Author : >><<log author name::Test User>><<log:: <>><<log author email::test.user@example.com>><<log::> (>><<log author timestamp local format::2001-02-03 08:05:07>><<log::)>>
<<log::Committer: >><<log committer name::Test User>><<log:: <>><<log committer email::test.user@example.com>><<log::> (>><<log committer timestamp local format::2001-02-03 08:05:07>><<log::)>>
<<log::>>
<<log empty description placeholder:: (no description set)>><<log::>>
<<log::>>
<<node immutable::>> <<log::Commit ID: >><<log commit_id::0000000000000000000000000000000000000000>><<log::>>
<<log::Change ID: >><<log change_id::zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz>><<log::>>
<<log::Author: >><<log name placeholder::(no name set)>><<log:: <>><<log email placeholder::(no email set)>><<log::> (>><<log author timestamp local format::1970-01-01 11:00:00>><<log::)>>
<<log::Author : >><<log name placeholder::(no name set)>><<log:: <>><<log email placeholder::(no email set)>><<log::> (>><<log author timestamp local format::1970-01-01 11:00:00>><<log::)>>
<<log::Committer: >><<log name placeholder::(no name set)>><<log:: <>><<log email placeholder::(no email set)>><<log::> (>><<log committer timestamp local format::1970-01-01 11:00:00>><<log::)>>
<<log::>>
<<log empty description placeholder:: (no description set)>><<log::>>
<<log::>>
"###);
"#);
}
#[test]

View file

@ -2086,10 +2086,10 @@ fn test_diff_external_tool() {
"###);
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["show", "--tool=fake-diff-editor"]), @r###"
test_env.jj_cmd_success(&repo_path, &["show", "--tool=fake-diff-editor"]), @r#"
Commit ID: 39d9055d70873099fd924b9af218289d5663eac8
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Author: Test User <test.user@example.com> (2001-02-03 08:05:09)
Author : Test User <test.user@example.com> (2001-02-03 08:05:09)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:09)
(no description set)
@ -2099,7 +2099,7 @@ fn test_diff_external_tool() {
--
file2
file3
"###);
"#);
// Enabled by default, looks up the merge-tools table
let config = "--config-toml=ui.diff.tool='fake-diff-editor'";
@ -2133,16 +2133,16 @@ fn test_diff_external_tool() {
// Non-zero exit code isn't an error
std::fs::write(&edit_script, "print diff\0fail").unwrap();
let (stdout, stderr) = test_env.jj_cmd_ok(&repo_path, &["show", "--tool=fake-diff-editor"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: 39d9055d70873099fd924b9af218289d5663eac8
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Author: Test User <test.user@example.com> (2001-02-03 08:05:09)
Author : Test User <test.user@example.com> (2001-02-03 08:05:09)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:09)
(no description set)
diff
"###);
"#);
insta::assert_snapshot!(stderr.replace("exit code:", "exit status:"), @r###"
Warning: Tool exited with exit status: 1 (run with --debug to see the exact invocation)
"###);
@ -2237,10 +2237,10 @@ fn test_diff_external_file_by_file_tool() {
"###);
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["show", config]), @r###"
test_env.jj_cmd_success(&repo_path, &["show", config]), @r#"
Commit ID: 7b01704a670bc77d11ed117d362855cff1d4513b
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Author: Test User <test.user@example.com> (2001-02-03 08:05:09)
Author : Test User <test.user@example.com> (2001-02-03 08:05:09)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:09)
(no description set)
@ -2257,7 +2257,7 @@ fn test_diff_external_file_by_file_tool() {
file1
--
file4
"###);
"#);
}
#[cfg(unix)]

View file

@ -26,12 +26,12 @@ fn test_show() {
let stdout = test_env.jj_cmd_success(&repo_path, &["show"]);
let stdout = stdout.lines().skip(2).join("\n");
insta::assert_snapshot!(stdout, @r###"
Author: Test User <test.user@example.com> (2001-02-03 08:05:07)
insta::assert_snapshot!(stdout, @r#"
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)
"###);
"#);
}
#[test]
@ -48,10 +48,10 @@ fn test_show_basic() {
std::fs::write(repo_path.join("file3"), "foo\n").unwrap();
let stdout = test_env.jj_cmd_success(&repo_path, &["show"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: e34f04317a81edc6ba41fef239c0d0180f10656f
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Author: Test User <test.user@example.com> (2001-02-03 08:05:09)
Author : Test User <test.user@example.com> (2001-02-03 08:05:09)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:09)
(no description set)
@ -61,13 +61,13 @@ fn test_show_basic() {
2: bar
2 3: baz quxquux
Modified regular file file3 (file1 => file3):
"###);
"#);
let stdout = test_env.jj_cmd_success(&repo_path, &["show", "--context=0"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: e34f04317a81edc6ba41fef239c0d0180f10656f
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Author: Test User <test.user@example.com> (2001-02-03 08:05:09)
Author : Test User <test.user@example.com> (2001-02-03 08:05:09)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:09)
(no description set)
@ -77,13 +77,13 @@ fn test_show_basic() {
2: bar
2 3: baz quxquux
Modified regular file file3 (file1 => file3):
"###);
"#);
let stdout = test_env.jj_cmd_success(&repo_path, &["show", "--color=debug"]);
insta::assert_snapshot!(stdout, @r#"
Commit ID: <<commit_id::e34f04317a81edc6ba41fef239c0d0180f10656f>>
Change ID: <<change_id::rlvkpnrzqnoowoytxnquwvuryrwnrmlp>>
Author: <<author name::Test User>> <<<author email::test.user@example.com>>> (<<author timestamp local format::2001-02-03 08:05:09>>)
Author : <<author name::Test User>> <<<author email::test.user@example.com>>> (<<author timestamp local format::2001-02-03 08:05:09>>)
Committer: <<committer name::Test User>> <<<committer email::test.user@example.com>>> (<<committer timestamp local format::2001-02-03 08:05:09>>)
<<description placeholder:: (no description set)>>
@ -96,36 +96,36 @@ fn test_show_basic() {
"#);
let stdout = test_env.jj_cmd_success(&repo_path, &["show", "-s"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: e34f04317a81edc6ba41fef239c0d0180f10656f
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Author: Test User <test.user@example.com> (2001-02-03 08:05:09)
Author : Test User <test.user@example.com> (2001-02-03 08:05:09)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:09)
(no description set)
M file2
R {file1 => file3}
"###);
"#);
let stdout = test_env.jj_cmd_success(&repo_path, &["show", "--types"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: e34f04317a81edc6ba41fef239c0d0180f10656f
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Author: Test User <test.user@example.com> (2001-02-03 08:05:09)
Author : Test User <test.user@example.com> (2001-02-03 08:05:09)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:09)
(no description set)
FF file2
FF {file1 => file3}
"###);
"#);
let stdout = test_env.jj_cmd_success(&repo_path, &["show", "--git"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: e34f04317a81edc6ba41fef239c0d0180f10656f
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Author: Test User <test.user@example.com> (2001-02-03 08:05:09)
Author : Test User <test.user@example.com> (2001-02-03 08:05:09)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:09)
(no description set)
@ -142,13 +142,13 @@ fn test_show_basic() {
diff --git a/file1 b/file3
rename from file1
rename to file3
"###);
"#);
let stdout = test_env.jj_cmd_success(&repo_path, &["show", "--git", "--context=0"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: e34f04317a81edc6ba41fef239c0d0180f10656f
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Author: Test User <test.user@example.com> (2001-02-03 08:05:09)
Author : Test User <test.user@example.com> (2001-02-03 08:05:09)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:09)
(no description set)
@ -164,13 +164,13 @@ fn test_show_basic() {
diff --git a/file1 b/file3
rename from file1
rename to file3
"###);
"#);
let stdout = test_env.jj_cmd_success(&repo_path, &["show", "--git", "--color=debug"]);
insta::assert_snapshot!(stdout, @r#"
Commit ID: <<commit_id::e34f04317a81edc6ba41fef239c0d0180f10656f>>
Change ID: <<change_id::rlvkpnrzqnoowoytxnquwvuryrwnrmlp>>
Author: <<author name::Test User>> <<<author email::test.user@example.com>>> (<<author timestamp local format::2001-02-03 08:05:09>>)
Author : <<author name::Test User>> <<<author email::test.user@example.com>>> (<<author timestamp local format::2001-02-03 08:05:09>>)
Committer: <<committer name::Test User>> <<<committer email::test.user@example.com>>> (<<committer timestamp local format::2001-02-03 08:05:09>>)
<<description placeholder:: (no description set)>>
@ -190,10 +190,10 @@ fn test_show_basic() {
"#);
let stdout = test_env.jj_cmd_success(&repo_path, &["show", "-s", "--git"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: e34f04317a81edc6ba41fef239c0d0180f10656f
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Author: Test User <test.user@example.com> (2001-02-03 08:05:09)
Author : Test User <test.user@example.com> (2001-02-03 08:05:09)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:09)
(no description set)
@ -212,13 +212,13 @@ fn test_show_basic() {
diff --git a/file1 b/file3
rename from file1
rename to file3
"###);
"#);
let stdout = test_env.jj_cmd_success(&repo_path, &["show", "--stat"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: e34f04317a81edc6ba41fef239c0d0180f10656f
Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
Author: Test User <test.user@example.com> (2001-02-03 08:05:09)
Author : Test User <test.user@example.com> (2001-02-03 08:05:09)
Committer: Test User <test.user@example.com> (2001-02-03 08:05:09)
(no description set)
@ -226,7 +226,7 @@ fn test_show_basic() {
file2 | 3 ++-
{file1 => file3} | 0
2 files changed, 2 insertions(+), 1 deletion(-)
"###);
"#);
}
#[test]
@ -294,10 +294,10 @@ fn test_show_relative_timestamps() {
.map(|x| timestamp_re.replace_all(x, "(...timestamp...)"))
.join("\n");
insta::assert_snapshot!(stdout, @r###"
Author: Test User <test.user@example.com> (...timestamp...)
insta::assert_snapshot!(stdout, @r#"
Author : Test User <test.user@example.com> (...timestamp...)
Committer: Test User <test.user@example.com> (...timestamp...)
(no description set)
"###);
"#);
}