diff --git a/CHANGELOG.md b/CHANGELOG.md index 15ff115076..733fa32f8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). * Help command doesn't work recursively anymore, i.e. `jj workspace help root` doesn't work anymore. +* The color label `op_log` from the `[colors]` config section now **only** + applies to the op log and not to the other places operations are displayed. In + almost all cases, if you configured `op_log` before, you should use the new + `operation` label instead. + * Default operation log template now shows end times of operations instead of start times. diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index ddf69bca38..4dbc32f7ec 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -1491,12 +1491,7 @@ impl WorkspaceCommandHelper { &self.op_summary_template_text, OperationTemplateLanguage::wrap_operation, ) - // TODO: "op_log" is not a great label name for op_summary. We could - // replace it with `operation summary` and use `operation` in - // colors.toml. TODO: It would be better to put labels like these - // consistently in the same place, e.g. `templates.toml` instead of the - // rust code. - .labeled("op_log") + .labeled("operation") } pub fn short_change_id_template(&self) -> TemplateRenderer<'_, Commit> { diff --git a/cli/src/commands/operation/log.rs b/cli/src/commands/operation/log.rs index 03308172e7..5f5242c7fc 100644 --- a/cli/src/commands/operation/log.rs +++ b/cli/src/commands/operation/log.rs @@ -130,6 +130,7 @@ fn do_op_log( &text, OperationTemplateLanguage::wrap_operation, )? + .labeled("operation") .labeled("op_log"); op_node_template = workspace_env .parse_template( diff --git a/cli/src/commands/operation/show.rs b/cli/src/commands/operation/show.rs index bc67e19b22..8be3aed534 100644 --- a/cli/src/commands/operation/show.rs +++ b/cli/src/commands/operation/show.rs @@ -82,7 +82,7 @@ pub fn cmd_op_show( let text = command.settings().config().get_string("templates.op_log")?; workspace_command .parse_operation_template(ui, &text)? - .labeled("op_log") + .labeled("operation") }; ui.request_pager(); diff --git a/cli/src/config/colors.toml b/cli/src/config/colors.toml index 66741f4851..e14763d2d0 100644 --- a/cli/src/config/colors.toml +++ b/cli/src/config/colors.toml @@ -97,13 +97,13 @@ "diff copied" = "green" "diff access-denied" = { bg = "red" } -"op_log id" = "blue" -"op_log user" = "yellow" -"op_log time" = "cyan" -"op_log current_operation" = { bold = true } -"op_log current_operation id" = "bright blue" -"op_log current_operation user" = "yellow" # No bright yellow, see comment above -"op_log current_operation time" = "bright cyan" +"operation id" = "blue" +"operation user" = "yellow" +"operation time" = "cyan" +"operation current_operation" = { bold = true } +"operation current_operation id" = "bright blue" +"operation current_operation user" = "yellow" # No bright yellow, see comment above +"operation current_operation time" = "bright cyan" "node elided" = { fg = "bright black" } "node working_copy" = { fg = "green", bold = true } diff --git a/cli/tests/test_operations.rs b/cli/tests/test_operations.rs index 8aac187c5f..710b6e40ef 100644 --- a/cli/tests/test_operations.rs +++ b/cli/tests/test_operations.rs @@ -820,7 +820,7 @@ fn test_op_summary_diff_template() { let (stdout, stderr) = test_env.jj_cmd_ok(&repo_path, &["op", "undo", "--color=debug"]); insta::assert_snapshot!(&stdout, @""); insta::assert_snapshot!(&stderr, @r#" - Undid operation: <><><><><> + Undid operation: <><><><><> "#); let stdout = test_env.jj_cmd_success( &repo_path, @@ -835,8 +835,8 @@ fn test_op_summary_diff_template() { ], ); insta::assert_snapshot!(&stdout, @r#" - From operation: <><><> - To operation: <><><><><> + From operation: <><><> + To operation: <><><><><> Changed commits: ○ Change qpvuntsmwlqt