mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-27 06:23:18 +00:00
cli: do not include separator in labeled log template fields
This commit is contained in:
parent
13b5661094
commit
eb3aeb42dc
2 changed files with 11 additions and 11 deletions
|
@ -1433,9 +1433,9 @@ fn log_template(settings: &UserSettings) -> String {
|
|||
if(working_copies, " " working_copies)
|
||||
if(git_head, " " git_head)
|
||||
" " commit_id.{prefix_format}
|
||||
if(conflict, label("conflict", " conflict"))
|
||||
if(conflict, " " label("conflict", "conflict"))
|
||||
"\n"
|
||||
if(empty, label("empty", "(empty) "))
|
||||
if(empty, label("empty", "(empty)") " ")
|
||||
if(description, description.first_line(), {DESCRIPTION_PLACEHOLDER_TEMPLATE})
|
||||
"\n"
|
||||
)"#,
|
||||
|
|
|
@ -99,11 +99,11 @@ fn test_log_default() {
|
|||
);
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
@ [1m[38;5;13mf[38;5;8mfdaa62087a2[39m [38;5;3mtest.user@example.com[39m [38;5;14m2001-02-03 04:05:09.000 +07:00[39m [38;5;13mmy-branch[39m [38;5;12m9d[38;5;8me54178d59d[39m[0m
|
||||
| [1m[38;5;10m(empty) [39mdescription 1[0m
|
||||
| [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
|
||||
[38;5;2m(empty) [39m(no description set)
|
||||
[38;5;2m(empty)[39m (no description set)
|
||||
"###);
|
||||
|
||||
// Test default log output format with prefixes explicitly disabled
|
||||
|
@ -124,22 +124,22 @@ fn test_log_default() {
|
|||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "--color=always"]);
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
@ [1m[38;5;13mf[38;5;8mfdaa62087a2[39m [38;5;3mtest.user@example.com[39m [38;5;14m2001-02-03 04:05:09.000 +07:00[39m [38;5;13mmy-branch[39m [38;5;12m9d[38;5;8me54178d59d[39m[0m
|
||||
| [1m[38;5;10m(empty) [39mdescription 1[0m
|
||||
| [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
|
||||
[38;5;2m(empty) [39m(no description set)
|
||||
[38;5;2m(empty)[39m (no description set)
|
||||
"###);
|
||||
|
||||
// Color without graph
|
||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "--color=always", "--no-graph"]);
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
[1m[38;5;13mf[38;5;8mfdaa62087a2[39m [38;5;3mtest.user@example.com[39m [38;5;14m2001-02-03 04:05:09.000 +07:00[39m [38;5;13mmy-branch[39m [38;5;12m9d[38;5;8me54178d59d[39m[0m
|
||||
[1m[38;5;10m(empty) [39mdescription 1[0m
|
||||
[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
|
||||
[38;5;2m(empty) [39m(no description set)
|
||||
[38;5;2m(empty)[39m (no description set)
|
||||
"###);
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ fn test_log_default_divergence() {
|
|||
| @ [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
|
||||
[38;5;2m(empty) [39m(no description set)
|
||||
[38;5;2m(empty)[39m (no description set)
|
||||
"###);
|
||||
}
|
||||
|
||||
|
@ -202,8 +202,8 @@ fn test_log_git_head() {
|
|||
@ [1m[38;5;13m8[38;5;8me4fac809cbb[39m [38;5;3mtest.user@example.com[39m [38;5;14m2001-02-03 04:05:09.000 +07:00[39m [38;5;12m5[38;5;8m0aaf4754c1e[39m[0m
|
||||
| [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)
|
||||
| [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
|
||||
[38;5;2m(empty) [39m(no description set)
|
||||
[38;5;2m(empty)[39m (no description set)
|
||||
"###);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue