Skip to content

Commit

Permalink
templates: default placeholders to red
Browse files Browse the repository at this point in the history
With the idea that less severe placeholders (like description) could
(and should) explicitly "opt out".

(Both email and name placeholders will be red with this change.)
  • Loading branch information
avamsi committed Aug 30, 2023
1 parent dbf13a5 commit 32377a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions cli/src/config/colors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"divergent change_id"="red"
"conflict" = "red"
"empty" = "green"
"placeholder" = "red"
"description placeholder" = "yellow"
"empty description placeholder" = "green"
"separator" = "bright black"
Expand All @@ -53,6 +54,7 @@
"working_copy divergent change_id" = "bright red"
"working_copy conflict" = "bright red"
"working_copy empty" = "bright green"
"working_copy placeholder" = "bright red"
"working_copy description placeholder" = "yellow"
"working_copy empty description placeholder" = "bright green"
"diff header" = "yellow"
Expand Down
14 changes: 7 additions & 7 deletions cli/tests/test_commit_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,21 +248,21 @@ fn test_log_builtin_templates_colored() {
);

insta::assert_snapshot!(render(r#"builtin_log_oneline"#), @r###"
@ [1m[38;5;13mr[38;5;8mlvkpnrz[39m [38;5;3m(no email set)[39m [38;5;14m2001-02-03 04:05:08.000 +07:00[39m [38;5;12md[38;5;8mc315397[39m [38;5;10m(empty)[39m [38;5;10m(no description set)[39m[0m
@ [1m[38;5;13mr[38;5;8mlvkpnrz[39m [38;5;9m(no email set)[39m [38;5;14m2001-02-03 04:05:08.000 +07:00[39m [38;5;12md[38;5;8mc315397[39m [38;5;10m(empty)[39m [38;5;10m(no description set)[39m[0m
◉ qpvuntsm test.user 2001-02-03 04:05:07.000 +07:00 230dd059 (empty) (no description set)
◉ zzzzzzzz root 00000000
"###);

insta::assert_snapshot!(render(r#"builtin_log_compact"#), @r###"
@ [1m[38;5;13mr[38;5;8mlvkpnrz[39m [38;5;3m(no email set)[39m [38;5;14m2001-02-03 04:05:08.000 +07:00[39m [38;5;12md[38;5;8mc315397[39m[0m
@ [1m[38;5;13mr[38;5;8mlvkpnrz[39m [38;5;9m(no email set)[39m [38;5;14m2001-02-03 04:05:08.000 +07:00[39m [38;5;12md[38;5;8mc315397[39m[0m
│ (empty) (no description set)
◉ qpvuntsm [38;5;[email protected] 2001-02-03 04:05:07.000 +07:00 230dd059
│ (empty) (no description set)
◉ zzzzzzzz root 00000000
"###);

insta::assert_snapshot!(render(r#"builtin_log_comfortable"#), @r###"
@ [1m[38;5;13mr[38;5;8mlvkpnrz[39m [38;5;3m(no email set)[39m [38;5;14m2001-02-03 04:05:08.000 +07:00[39m [38;5;12md[38;5;8mc315397[39m[0m
@ [1m[38;5;13mr[38;5;8mlvkpnrz[39m [38;5;9m(no email set)[39m [38;5;14m2001-02-03 04:05:08.000 +07:00[39m [38;5;12md[38;5;8mc315397[39m[0m
│ (empty) (no description set)
◉ qpvuntsm [38;5;[email protected] 2001-02-03 04:05:07.000 +07:00 230dd059
Expand All @@ -274,8 +274,8 @@ fn test_log_builtin_templates_colored() {
insta::assert_snapshot!(render(r#"builtin_log_detailed"#), @r###"
@ Commit ID: dc31539712c7294d1d712cec63cef4504b94ca74
│ Change ID: rlvkpnrzqnoowoytxnquwvuryrwnrmlp
│ Author: (no name set) <[38;5;3m(no email set)[39m> ([38;5;6m2001-02-03 04:05:08.000 +07:00[39m)
│ Committer: (no name set) <[38;5;3m(no email set)[39m> ([38;5;6m2001-02-03 04:05:08.000 +07:00[39m)
│ Author: [38;5;1m(no name set)[39m <[38;5;1m(no email set)[39m> ([38;5;6m2001-02-03 04:05:08.000 +07:00[39m)
│ Committer: [38;5;1m(no name set)[39m <[38;5;1m(no email set)[39m> ([38;5;6m2001-02-03 04:05:08.000 +07:00[39m)
│  (no description set)
Expand All @@ -288,8 +288,8 @@ fn test_log_builtin_templates_colored() {
◉ Commit ID: 0000000000000000000000000000000000000000
Change ID: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
Author: (no name set) <[38;5;3m(no email set)[39m> ([38;5;6m1970-01-01 00:00:00.000 +00:00[39m)
Committer: (no name set) <[38;5;3m(no email set)[39m> ([38;5;6m1970-01-01 00:00:00.000 +00:00[39m)
Author: [38;5;1m(no name set)[39m <[38;5;1m(no email set)[39m> ([38;5;6m1970-01-01 00:00:00.000 +00:00[39m)
Committer: [38;5;1m(no name set)[39m <[38;5;1m(no email set)[39m> ([38;5;6m1970-01-01 00:00:00.000 +00:00[39m)
 (no description set)
Expand Down

0 comments on commit 32377a1

Please sign in to comment.