diff --git a/CHANGELOG.md b/CHANGELOG.md index d8fdc383b..3d6005eeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,7 +87,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 still accepted for backwards compatibility for some time. * Commands that draw an ASCII graph (`jj log`, `jj op log`, `jj obslog`) now - have different styles available by setting e.g. `ui.graph.format = "curved"`. + have different styles available by setting e.g. `ui.graph.style = "curved"`. ### Fixed bugs diff --git a/docs/config.md b/docs/config.md index 496c98f0c..f74972830 100644 --- a/docs/config.md +++ b/docs/config.md @@ -55,7 +55,7 @@ ui.color = "never" # Turn off color ```toml # Possible values: "curved", "square", "ascii", "ascii-large", # "legacy" (default) -ui.graph.format = "curved" +ui.graph.style = "curved" ``` ### Shortest unique prefixes for ids diff --git a/lib/src/settings.rs b/lib/src/settings.rs index d75cabce8..c0c5f379c 100644 --- a/lib/src/settings.rs +++ b/lib/src/settings.rs @@ -153,9 +153,9 @@ impl UserSettings { &self.config } - pub fn graph_format(&self) -> String { + pub fn graph_style(&self) -> String { self.config - .get_string("ui.graph.format") + .get_string("ui.graph.style") .unwrap_or_else(|_| "legacy".to_string()) } } diff --git a/src/graphlog.rs b/src/graphlog.rs index 8c9f09bb1..8b1571835 100644 --- a/src/graphlog.rs +++ b/src/graphlog.rs @@ -120,7 +120,7 @@ pub fn get_graphlog<'a, K: Clone + Eq + Hash + 'a>( ) -> Box + 'a> { let builder = GraphRowRenderer::new().output().with_min_row_height(0); - match settings.graph_format().as_str() { + match settings.graph_style().as_str() { "curved" => SaplingGraphLog::create(builder.build_box_drawing(), formatter), "square" => { SaplingGraphLog::create(builder.build_box_drawing().with_square_glyphs(), formatter) diff --git a/tests/test_log_command.rs b/tests/test_log_command.rs index bbffe0c5d..48dbb0634 100644 --- a/tests/test_log_command.rs +++ b/tests/test_log_command.rs @@ -718,7 +718,7 @@ fn test_graph_styles() { "###); // ASCII style - test_env.add_config(r#"ui.graph.format = "ascii""#); + test_env.add_config(r#"ui.graph.style = "ascii""#); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T=description"]); insta::assert_snapshot!(stdout, @r###" @ merge @@ -735,7 +735,7 @@ fn test_graph_styles() { "###); // Large ASCII style - test_env.add_config(r#"ui.graph.format = "ascii-large""#); + test_env.add_config(r#"ui.graph.style = "ascii-large""#); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T=description"]); insta::assert_snapshot!(stdout, @r###" @ merge @@ -754,7 +754,7 @@ fn test_graph_styles() { "###); // Curved style - test_env.add_config(r#"ui.graph.format = "curved""#); + test_env.add_config(r#"ui.graph.style = "curved""#); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T=description"]); insta::assert_snapshot!(stdout, @r###" @ merge @@ -771,7 +771,7 @@ fn test_graph_styles() { "###); // Square style - test_env.add_config(r#"ui.graph.format = "square""#); + test_env.add_config(r#"ui.graph.style = "square""#); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T=description"]); insta::assert_snapshot!(stdout, @r###" @ merge