Fix typos and slightly simplify code from #1235

This commit is contained in:
Vamsi Avula 2023-02-11 18:57:23 +05:30 committed by Vamsi Avula
parent daf7b656e3
commit 98261e81e2
3 changed files with 9 additions and 10 deletions

View file

@ -146,7 +146,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
domain information of `.email()`.
* It is now possible to change the author format of `jj log` with the new
`ui.log_author_format` option.
`ui.log-author-format` option.
### Fixed bugs

View file

@ -144,7 +144,7 @@ as `x days/hours/seconds ago` instead of being rendered as a full timestamp.
### Author format
```toml
ui.log_author_format = 'username'
ui.log-author-format = 'username'
```
Supported values are,

View file

@ -1436,13 +1436,12 @@ fn log_template(settings: &UserSettings) -> String {
_ => format!("short({desired_id_len})"),
};
let author_template = match settings.log_author_format().as_str() {
"none" => None,
"full" => Some("author"),
"name" => Some("author.name()"),
"username" => Some("author.username()"),
_ => Some("author.email()"),
}
.map_or("".to_owned(), |t| t.to_owned() + ",");
"none" => r#""""#,
"full" => "author",
"name" => "author.name()",
"username" => "author.username()",
_ => "author.email()",
};
let default_template = format!(
r#"
label(if(current_working_copy, "working_copy"),
@ -1450,7 +1449,7 @@ fn log_template(settings: &UserSettings) -> String {
if(divergent,
label("divergent", change_id.{prefix_format} "??"),
change_id.{prefix_format}),
{author_template}
{author_template},
{committer_timestamp},
branches,
tags,