mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 02:04:19 +00:00
cli: omit log template separator if author.email() is empty
This commit is contained in:
parent
eb3aeb42dc
commit
fbd6657e3f
4 changed files with 15 additions and 15 deletions
|
@ -1426,7 +1426,7 @@ fn log_template(settings: &UserSettings) -> String {
|
|||
if(divergent,
|
||||
label("divergent", change_id.{prefix_format} "??"),
|
||||
change_id.{prefix_format})
|
||||
" " author.email()
|
||||
if(author.email(), " " author.email())
|
||||
" " {committer_timestamp}
|
||||
if(branches, " " branches)
|
||||
if(tags, " " tags)
|
||||
|
|
|
@ -135,7 +135,7 @@ fn test_alias_cannot_override_builtin() {
|
|||
// Alias should be ignored
|
||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "root"]);
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
(empty) (no description set)
|
||||
"###);
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ fn test_log_default() {
|
|||
| (empty) description 1
|
||||
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97
|
||||
| add a file
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
(empty) (no description set)
|
||||
"###);
|
||||
|
||||
|
@ -83,7 +83,7 @@ fn test_log_default() {
|
|||
| (empty) description 1
|
||||
o 9a[45c67d3e] test.user@example.com 2001-02-03 04:05:08.000 +07:00 4[291e264ae]
|
||||
| add a file
|
||||
o 0[000000000] 1970-01-01 00:00:00.000 +00:00 0[000000000]
|
||||
o 0[000000000] 1970-01-01 00:00:00.000 +00:00 0[000000000]
|
||||
(empty) (no description set)
|
||||
"###);
|
||||
|
||||
|
@ -102,7 +102,7 @@ fn test_log_default() {
|
|||
| [1m[38;5;10m(empty)[39m description 1[0m
|
||||
o [1m[38;5;5m9a[0m[38;5;8m45c67d3e96[39m [38;5;3mtest.user@example.com[39m [38;5;6m2001-02-03 04:05:08.000 +07:00[39m [1m[38;5;4m4[0m[38;5;8m291e264ae97[39m
|
||||
| add a file
|
||||
o [1m[38;5;5m0[0m[38;5;8m00000000000[39m [38;5;6m1970-01-01 00:00:00.000 +00:00[39m [1m[38;5;4m0[0m[38;5;8m00000000000[39m
|
||||
o [1m[38;5;5m0[0m[38;5;8m00000000000[39m [38;5;6m1970-01-01 00:00:00.000 +00:00[39m [1m[38;5;4m0[0m[38;5;8m00000000000[39m
|
||||
[38;5;2m(empty)[39m (no description set)
|
||||
"###);
|
||||
|
||||
|
@ -116,7 +116,7 @@ fn test_log_default() {
|
|||
| (empty) description 1
|
||||
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97
|
||||
| add a file
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
(empty) (no description set)
|
||||
"###);
|
||||
|
||||
|
@ -127,7 +127,7 @@ fn test_log_default() {
|
|||
| [1m[38;5;10m(empty)[39m description 1[0m
|
||||
o [1m[38;5;5m9a[0m[38;5;8m45c67d3e96[39m [38;5;3mtest.user@example.com[39m [38;5;6m2001-02-03 04:05:08.000 +07:00[39m [1m[38;5;4m4[0m[38;5;8m291e264ae97[39m
|
||||
| add a file
|
||||
o [1m[38;5;5m0[0m[38;5;8m00000000000[39m [38;5;6m1970-01-01 00:00:00.000 +00:00[39m [1m[38;5;4m0[0m[38;5;8m00000000000[39m
|
||||
o [1m[38;5;5m0[0m[38;5;8m00000000000[39m [38;5;6m1970-01-01 00:00:00.000 +00:00[39m [1m[38;5;4m0[0m[38;5;8m00000000000[39m
|
||||
[38;5;2m(empty)[39m (no description set)
|
||||
"###);
|
||||
|
||||
|
@ -138,7 +138,7 @@ fn test_log_default() {
|
|||
[1m[38;5;10m(empty)[39m description 1[0m
|
||||
[1m[38;5;5m9a[0m[38;5;8m45c67d3e96[39m [38;5;3mtest.user@example.com[39m [38;5;6m2001-02-03 04:05:08.000 +07:00[39m [1m[38;5;4m4[0m[38;5;8m291e264ae97[39m
|
||||
add a file
|
||||
[1m[38;5;5m0[0m[38;5;8m00000000000[39m [38;5;6m1970-01-01 00:00:00.000 +00:00[39m [1m[38;5;4m0[0m[38;5;8m00000000000[39m
|
||||
[1m[38;5;5m0[0m[38;5;8m00000000000[39m [38;5;6m1970-01-01 00:00:00.000 +00:00[39m [1m[38;5;4m0[0m[38;5;8m00000000000[39m
|
||||
[38;5;2m(empty)[39m (no description set)
|
||||
"###);
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ fn test_log_default_divergence() {
|
|||
insta::assert_snapshot!(stdout, @r###"
|
||||
@ 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c
|
||||
| description 1
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
(empty) (no description set)
|
||||
"###);
|
||||
|
||||
|
@ -172,7 +172,7 @@ fn test_log_default_divergence() {
|
|||
| description 2
|
||||
| @ 9a45c67d3e96?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c
|
||||
|/ description 1
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
(empty) (no description set)
|
||||
"###);
|
||||
|
||||
|
@ -183,7 +183,7 @@ fn test_log_default_divergence() {
|
|||
| description 2
|
||||
| @ [1m[4m[38;5;1m9[24ma45c67d3e96[38;5;9m??[39m [38;5;3mtest.user@example.com[39m [38;5;14m2001-02-03 04:05:08.000 +07:00[39m [38;5;12m7[38;5;8ma17d52e633c[39m[0m
|
||||
|/ [1mdescription 1[0m
|
||||
o [1m[38;5;5m0[0m[38;5;8m00000000000[39m [38;5;6m1970-01-01 00:00:00.000 +00:00[39m [1m[38;5;4m0[0m[38;5;8m00000000000[39m
|
||||
o [1m[38;5;5m0[0m[38;5;8m00000000000[39m [38;5;6m1970-01-01 00:00:00.000 +00:00[39m [1m[38;5;4m0[0m[38;5;8m00000000000[39m
|
||||
[38;5;2m(empty)[39m (no description set)
|
||||
"###);
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ fn test_log_git_head() {
|
|||
| [1minitial[0m
|
||||
o [1m[38;5;5m9[0m[38;5;8ma45c67d3e96[39m [38;5;3mtest.user@example.com[39m [38;5;6m2001-02-03 04:05:07.000 +07:00[39m [38;5;5mmaster[39m [38;5;5mHEAD@git[39m [1m[38;5;4m23[0m[38;5;8m0dd059e1b0[39m
|
||||
| [38;5;2m(empty)[39m (no description set)
|
||||
o [1m[38;5;5m0[0m[38;5;8m00000000000[39m [38;5;6m1970-01-01 00:00:00.000 +00:00[39m [1m[38;5;4m0[0m[38;5;8m00000000000[39m
|
||||
o [1m[38;5;5m0[0m[38;5;8m00000000000[39m [38;5;6m1970-01-01 00:00:00.000 +00:00[39m [1m[38;5;4m0[0m[38;5;8m00000000000[39m
|
||||
[38;5;2m(empty)[39m (no description set)
|
||||
"###);
|
||||
}
|
||||
|
|
|
@ -161,13 +161,13 @@ fn test_alias() {
|
|||
|
||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "my-root"]);
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
(empty) (no description set)
|
||||
"###);
|
||||
|
||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "identity(my-root)"]);
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
(empty) (no description set)
|
||||
"###);
|
||||
|
||||
|
@ -263,7 +263,7 @@ fn test_bad_alias_decl() {
|
|||
.assert()
|
||||
.success();
|
||||
insta::assert_snapshot!(get_stdout_string(&assert), @r###"
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
|
||||
(empty) (no description set)
|
||||
"###);
|
||||
insta::assert_snapshot!(get_stderr_string(&assert), @r###"
|
||||
|
|
Loading…
Reference in a new issue