Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color signature names yellow within the log #4335

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
to keeping all changes into the first commit while keeping the current commit
description for the second commit (the newly created empty one).

* Color author and committer names yellow

### Fixed bugs

* Update working copy before reporting changes. This prevents errors during reporting
Expand Down
7 changes: 4 additions & 3 deletions cli/src/config/colors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"divergent prefix" = { fg = "red", underline = true }
"hidden prefix" = "default"

"email" = "yellow"
"username" = "yellow"
"author" = "yellow"
"committer" = "yellow"
qubitz marked this conversation as resolved.
Show resolved Hide resolved
"timestamp" = "cyan"
"working_copies" = "green"
"bookmark" = "magenta"
Expand Down Expand Up @@ -54,7 +54,8 @@
"working_copy change_id" = "bright magenta"
# We do not use bright yellow because of how it looks on xterm's default theme.
# https://github.com/martinvonz/jj/issues/528
"working_copy email" = "yellow"
"working_copy author" = "yellow"
"working_copy committer" = "yellow"
"working_copy timestamp" = "bright cyan"
"working_copy working_copies" = "bright green"
"working_copy bookmark" = "bright magenta"
Expand Down
8 changes: 4 additions & 4 deletions cli/tests/test_commit_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ fn test_log_builtin_templates_colored() {
○ Commit ID: 230dd059e1b059aefc0da06a2e5a7dbf22362f22
│ Change ID: qpvuntsmwlqtpsluzzsnyyzlmlwvmlnu
│ Author: Test User <[38;5;[email protected]> (2001-02-03 08:05:07)
│ Committer: Test User <[38;5;[email protected]> (2001-02-03 08:05:07)
│ Author: Test User <[38;5;[email protected]> (2001-02-03 08:05:07)
│ Committer: Test User <[38;5;[email protected]> (2001-02-03 08:05:07)
│  (no description set)
Expand Down Expand Up @@ -415,8 +415,8 @@ fn test_log_builtin_templates_colored_debug() {
│ <<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::[email protected]>><<log::> (>><<log author timestamp local format::2001-02-03 08:05:07>><<log::)>>
│ <<log::Committer: >><<log committer name::Test User>><<log:: <>><<log committer email::[email protected]>><<log::> (>><<log committer timestamp local format::2001-02-03 08:05:07>><<log::)>>
│ <<log::Author: >><<log author name::Test User>><<log:: <>><<log author email::[email protected]>><<log::> (>><<log author timestamp local format::2001-02-03 08:05:07>><<log::)>>
│ <<log::Committer: >><<log committer name::Test User>><<log:: <>><<log committer email::[email protected]>><<log::> (>><<log committer timestamp local format::2001-02-03 08:05:07>><<log::)>>
│ <<log::>>
│ <<log empty description placeholder:: (no description set)>><<log::>>
│ <<log::>>
Expand Down
16 changes: 8 additions & 8 deletions cli/tests/test_show_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ fn test_show_basic() {
"###);

let stdout = test_env.jj_cmd_success(&repo_path, &["show", "--color=debug"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: <<commit_id::e34f04317a81edc6ba41fef239c0d0180f10656f>>
Change ID: <<change_id::rlvkpnrzqnoowoytxnquwvuryrwnrmlp>>
Author: <<author name::Test User>> <<<author email::[email protected]>>> (<<author timestamp local format::2001-02-03 08:05:09>>)
Committer: <<committer name::Test User>> <<<committer email::[email protected]>>> (<<committer timestamp local format::2001-02-03 08:05:09>>)
Author: <<author name::Test User>> <<<author email::[email protected]>>> (<<author timestamp local format::2001-02-03 08:05:09>>)
Committer: <<committer name::Test User>> <<<committer email::[email protected]>>> (<<committer timestamp local format::2001-02-03 08:05:09>>)

<<description placeholder:: (no description set)>>

Expand All @@ -93,7 +93,7 @@ fn test_show_basic() {
<<diff:: >><<diff added line_number:: 2>><<diff::: >><<diff added token::bar>>
<<diff removed line_number:: 2>><<diff:: >><<diff added line_number:: 3>><<diff::: baz >><<diff removed token::qux>><<diff added token::quux>><<diff::>>
<<diff header::Modified regular file file3 (file1 => file3):>>
"###);
"#);

let stdout = test_env.jj_cmd_success(&repo_path, &["show", "-s"]);
insta::assert_snapshot!(stdout, @r###"
Expand Down Expand Up @@ -167,11 +167,11 @@ fn test_show_basic() {
"###);

let stdout = test_env.jj_cmd_success(&repo_path, &["show", "--git", "--color=debug"]);
insta::assert_snapshot!(stdout, @r###"
insta::assert_snapshot!(stdout, @r#"
Commit ID: <<commit_id::e34f04317a81edc6ba41fef239c0d0180f10656f>>
Change ID: <<change_id::rlvkpnrzqnoowoytxnquwvuryrwnrmlp>>
Author: <<author name::Test User>> <<<author email::[email protected]>>> (<<author timestamp local format::2001-02-03 08:05:09>>)
Committer: <<committer name::Test User>> <<<committer email::[email protected]>>> (<<committer timestamp local format::2001-02-03 08:05:09>>)
Author: <<author name::Test User>> <<<author email::[email protected]>>> (<<author timestamp local format::2001-02-03 08:05:09>>)
Committer: <<committer name::Test User>> <<<committer email::[email protected]>>> (<<committer timestamp local format::2001-02-03 08:05:09>>)

<<description placeholder:: (no description set)>>

Expand All @@ -187,7 +187,7 @@ fn test_show_basic() {
<<diff file_header::diff --git a/file1 b/file3>>
<<diff file_header::rename from file1>>
<<diff file_header::rename to file3>>
"###);
"#);

let stdout = test_env.jj_cmd_success(&repo_path, &["show", "-s", "--git"]);
insta::assert_snapshot!(stdout, @r###"
Expand Down