From 98261e81e2a9a31d4978e18a893a87679f312dc2 Mon Sep 17 00:00:00 2001 From: Vamsi Avula Date: Sat, 11 Feb 2023 18:57:23 +0530 Subject: [PATCH] Fix typos and slightly simplify code from #1235 --- CHANGELOG.md | 2 +- docs/config.md | 2 +- src/commands/mod.rs | 15 +++++++-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ea25f416..a62c7e8b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/config.md b/docs/config.md index 53e71173d..eb47e79a6 100644 --- a/docs/config.md +++ b/docs/config.md @@ -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, diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 50b41bbaa..6761cb622 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -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,