Skip to content

Commit

Permalink
cli: colorize tag name in "tag list" output
Browse files Browse the repository at this point in the history
"working_copy tag" wouldn't be needed, but is added for consistency.
  • Loading branch information
yuja committed May 3, 2024
1 parent 3f872a8 commit 6056b67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cli/src/config/colors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"branches" = "magenta"
"local_branches" = "magenta"
"remote_branches" = "magenta"
"tag" = "magenta"
"tags" = "magenta"
"git_refs" = "green"
"git_head" = "green"
Expand All @@ -55,6 +56,7 @@
"working_copy branches" = "bright magenta"
"working_copy local_branches" = "bright magenta"
"working_copy remote_branches" = "bright magenta"
"working_copy tag" = "bright magenta"
"working_copy tags" = "bright magenta"
"working_copy git_refs" = "bright green"
"working_copy divergent" = "bright red"
Expand Down
7 changes: 7 additions & 0 deletions cli/tests/test_tag_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ fn test_tag_list() {
test_tag2
"###);

insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["tag", "list", "--color=always"]),
@r###"
test_tag
test_tag2
"###);

// Test pattern matching.
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["tag", "list", "test_tag2"]),
Expand Down

0 comments on commit 6056b67

Please sign in to comment.