diff --git a/CHANGELOG.md b/CHANGELOG.md index d2ea92b66..571341161 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * The global `--no-commit-working-copy` is now called `--ignore-working-copy`. +* The `diff.format` config option is now called `ui.diff.format`. The old name + is still supported for now. + ### New features * The default log format now uses the committer timestamp instead of the author diff --git a/src/diff_util.rs b/src/diff_util.rs index 8c31dac7b..e752b1188 100644 --- a/src/diff_util.rs +++ b/src/diff_util.rs @@ -90,7 +90,13 @@ fn diff_formats_from_args(args: &DiffFormatArgs) -> Vec { } fn default_diff_format(settings: &UserSettings) -> DiffFormat { - match settings.config().get_string("diff.format").as_deref() { + match settings + .config() + .get_string("ui.diff.format") + // old config name + .or_else(|_| settings.config().get_string("diff.format")) + .as_deref() + { Ok("summary") => DiffFormat::Summary, Ok("git") => DiffFormat::Git, Ok("color-words") => DiffFormat::ColorWords, diff --git a/tests/test_log_command.rs b/tests/test_log_command.rs index 1a8c9be8c..75ff2c801 100644 --- a/tests/test_log_command.rs +++ b/tests/test_log_command.rs @@ -114,7 +114,7 @@ fn test_log_with_or_without_diff() { "description", "-p", "-s", - "--config-toml=diff.format='summary'", + "--config-toml=ui.diff.format='summary'", ], ); insta::assert_snapshot!(stdout, @r###"