From 5c82100ef0dd1c7c39ea6df7398f693c53bd461e Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Mon, 10 Jul 2023 16:05:56 -0500 Subject: [PATCH] fix(config): by default, render git refs as green instead of magenta Summary: Someone on Discord mentioned that while using branches, they could switch between branches like `m1` and `main`, but not `HEAD@git`, even though it was color coded the same and located right next to the other branch names in the default `jj log` output. This confused me too at first, until I realized `jj` was telling me that the given commit was the `HEAD` reference in the colocated git repo. Let's just color these references differently in the default schema, to try and hint that these aren't the same. `bright green` is arbitrary, but helps stand out; and `green` was only picked because both it and `git` start with "g". GitHub Issue: #1843 Signed-off-by: Austin Seipp Change-Id: I66d53ea2b9155db1fec6cae8ba8cbd0f --- src/config/colors.toml | 6 +++--- tests/test_commit_template.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config/colors.toml b/src/config/colors.toml index 399a0f6e5..cc5ccafc5 100644 --- a/src/config/colors.toml +++ b/src/config/colors.toml @@ -26,8 +26,8 @@ "branch" = "magenta" "branches" = "magenta" "tags" = "magenta" -"git_refs" = "magenta" -"git_head" = "magenta" +"git_refs" = "bright green" +"git_head" = "bright green" "divergent" = "red" "divergent change_id"="red" "conflict" = "red" @@ -44,7 +44,7 @@ "working_copy branch" = "bright magenta" "working_copy branches" = "bright magenta" "working_copy tags" = "bright magenta" -"working_copy git_refs" = "bright magenta" +"working_copy git_refs" = "bright green" "working_copy divergent" = "bright red" "working_copy divergent change_id" = "bright red" "working_copy conflict" = "bright red" diff --git a/tests/test_commit_template.rs b/tests/test_commit_template.rs index d9886888e..df442a024 100644 --- a/tests/test_commit_template.rs +++ b/tests/test_commit_template.rs @@ -281,7 +281,7 @@ fn test_log_git_head() { insta::assert_snapshot!(stdout, @r###" @ rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:09.000 +07:00 50aaf4754c1e │ initial - ◉ qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:07.000 +07:00 master HEAD@git 230dd059e1b0 + ◉ qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:07.000 +07:00 master HEAD@git 230dd059e1b0 │ (empty) (no description set) ◉ zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000 (empty) (no description set)