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

cli: rename diff.format to ui.diff.format

I felt that the config is too narrow to have it's own top-level [diff]
section, and I couldn't think of another good place to have it. I'm
happy to hear other suggestions.
This commit is contained in:
Martin von Zweigbergk 2023-02-05 22:42:27 -08:00 committed by Martin von Zweigbergk
parent f4374086b3
commit 8d3d89facc
3 changed files with 11 additions and 2 deletions

View file

@ -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

View file

@ -90,7 +90,13 @@ fn diff_formats_from_args(args: &DiffFormatArgs) -> Vec<DiffFormat> {
}
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,

View file

@ -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###"