Skip to content

Commit

Permalink
config: add color for renamed and copied in summary
Browse files Browse the repository at this point in the history
Right now, renamed and copied files don't have any color in the output
of `jj status`, and it makes them stand out. I think it's reasonable to
color renamed files the same as modified files, since renaming is like
modifying the path, and to color copied files the same as added files,
since they're basically just added files that happen to have similar
contents to an existing file.
  • Loading branch information
scott2000 committed Sep 4, 2024
1 parent 1c672d7 commit 52499e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cli/src/config/colors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
"diff added" = { fg = "green" }
"diff token" = { underline = true }
"diff modified" = "cyan"
"diff renamed" = "cyan"
"diff copied" = "green"
"diff access-denied" = { bg = "red" }

"op_log id" = "blue"
Expand Down
4 changes: 2 additions & 2 deletions cli/tests/test_commit_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ fn test_log_diff_predefined_formats() {
=== summary ===
M file1
M file2
R {rename-source => rename-target}
[38;5;6mR {rename-source => rename-target}[39m
"###);

// color labels
Expand Down Expand Up @@ -1063,7 +1063,7 @@ fn test_log_diff_predefined_formats() {
<<log::=== summary ===>>
<<log diff summary modified::M file1>>
<<log diff summary modified::M file2>>
<<log diff summary renamed::R {rename-source => rename-target}>>
[38;5;6m<<log diff summary renamed::R {rename-source => rename-target}>>[39m
"###);

// cwd != workspace root
Expand Down

0 comments on commit 52499e8

Please sign in to comment.