ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: don't show open commits in green when open commits are disabled

I had missed that `Ui::write_commit_summary()` still shows open
commits in green even when open commits are disabled (as they are by
default these days). This patch fixes that.

The user can still override templates to format open commits
differently, but I'm not sure it's worth fixing that.
This commit is contained in:
Martin von Zweigbergk 2022-09-16 23:44:39 -07:00 committed by Martin von Zweigbergk
parent f3d39c7820
commit 46578fb892

View file

@ -201,9 +201,11 @@ impl<'stdout> Ui<'stdout> {
.config()
.get_string("template.commit_summary")
.unwrap_or_else(|_| {
String::from(
r#"label(if(open, "open"), commit_id.short() " " description.first_line())"#,
)
if self.settings.enable_open_commits() {
String::from(r#"label(if(open, "open"), commit_id.short() " " description.first_line())"#)
} else {
String::from(r#"commit_id.short() " " description.first_line()"#)
}
});
let template =
crate::template_parser::parse_commit_template(repo, workspace_id, &template_string);