Repository: jesseduffield/lazygit (language: go)

Issue:
Show log graph in minimised commits view by default
**Is your feature request related to a problem? Please describe.**
See https://github.com/jesseduffield/lazygit/discussions/3311#discussioncomment-8388548

We want to change the default of the 'git.log.showGraph' config from 'when-maxmised' to 'always'

https://github.com/jesseduffield/lazygit/pull/3197 is related but falls back to config values anyway so it's not a blocker.


Discussion / hints:

Fix patch:
diff --git a/docs/Config.md b/docs/Config.md
index 312fd77f276..04bfbbc40ba 100644
--- a/docs/Config.md
+++ b/docs/Config.md
@@ -104,7 +104,7 @@ git:
     order: 'topo-order'
     # one of always, never, when-maximised
     # this determines whether the git graph is rendered in the commits panel
-    showGraph: 'when-maximised'
+    showGraph: 'always'
     # displays the whole git graph by default in the commits panel (equivalent to passing the `--all` argument to `git log`)
     showWholeGraph: false
   skipHookPrefix: WIP
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index 0069c75b08b..916b6dc90ea 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -662,7 +662,7 @@ func GetDefaultConfig() *UserConfig {
 			},
 			Log: LogConfig{
 				Order:          "topo-order",
-				ShowGraph:      "when-maximised",
+				ShowGraph:      "always",
 				ShowWholeGraph: false,
 			},
 			SkipHookPrefix:      "WIP",
diff --git a/schema/config.json b/schema/config.json
index 92ee774df04..0a78da23aaa 100644
--- a/schema/config.json
+++ b/schema/config.json
@@ -530,7 +530,7 @@
                 "when-maximised"
               ],
               "description": "This determines whether the git graph is rendered in the commits panel\nOne of 'always' | 'never' | 'when-maximised'",
-              "default": "when-maximised"
+              "default": "always"
             },
             "showWholeGraph": {
               "type": "boolean",


Test patch:
diff --git a/pkg/integration/tests/bisect/basic.go b/pkg/integration/tests/bisect/basic.go
index 1dfe6368b01..7e34e908faf 100644
--- a/pkg/integration/tests/bisect/basic.go
+++ b/pkg/integration/tests/bisect/basic.go
@@ -14,7 +14,9 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{
 			NewBranch("mybranch").
 			CreateNCommits(10)
 	},
-	SetupConfig: func(cfg *config.AppConfig) {},
+	SetupConfig: func(cfg *config.AppConfig) {
+		cfg.UserConfig.Git.Log.ShowGraph = "never"
+	},
 	Run: func(t *TestDriver, keys config.KeybindingConfig) {
 		markCommitAsBad := func() {
 			t.Views().Commits().
diff --git a/pkg/integration/tests/bisect/choose_terms.go b/pkg/integration/tests/bisect/choose_terms.go
index 825c8f5e21b..660204f98ba 100644
--- a/pkg/integration/tests/bisect/choose_terms.go
+++ b/pkg/integration/tests/bisect/choose_terms.go
@@ -14,7 +14,9 @@ var ChooseTerms = NewIntegrationTest(NewIntegrationTestArgs{
 			NewBranch("mybranch").
 			CreateNCommits(10)
 	},
-	SetupConfig: func(cfg *config.AppConfig) {},
+	SetupConfig: func(cfg *config.AppConfig) {
+		cfg.UserConfig.Git.Log.ShowGraph = "never"
+	},
 	Run: func(t *TestDriver, keys config.KeybindingConfig) {
 		markCommitAsFixed := func() {
 			t.Views().Commits().
diff --git a/pkg/integration/tests/bisect/skip.go b/pkg/integration/tests/bisect/skip.go
index 998e82361df..ff4c5c1b261 100644
--- a/pkg/integration/tests/bisect/skip.go
+++ b/pkg/integration/tests/bisect/skip.go
@@ -13,7 +13,9 @@ var Skip = NewIntegrationTest(NewIntegrationTestArgs{
 		shell.
 			CreateNCommits(10)
 	},
-	SetupConfig: func(cfg *config.AppConfig) {},
+	SetupConfig: func(cfg *config.AppConfig) {
+		cfg.UserConfig.Git.Log.ShowGraph = "never"
+	},
 	Run: func(t *TestDriver, keys config.KeybindingConfig) {
 		t.Views().Commits().
 			Focus().
diff --git a/pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go b/pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go
index caeb7bfe018..5dd6839a263 100644
--- a/pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go
+++ b/pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go
@@ -9,7 +9,9 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
 	Description:  "Cherry pick commits from the subcommits view during a rebase",
 	ExtraCmdArgs: []string{},
 	Skip:         false,
-	SetupConfig:  func(config *config.AppConfig) {},
+	SetupConfig: func(config *config.AppConfig) {
+		config.UserConfig.Git.Log.ShowGraph = "never"
+	},
 	SetupRepo: func(shell *Shell) {
 		shell.
 			EmptyCommit("base").
diff --git a/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go b/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go
index de085710afa..659df22c6cf 100644
--- a/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go
+++ b/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go
@@ -12,6 +12,7 @@ var DropTodoCommitWithUpdateRef = NewIntegrationTest(NewIntegrationTestArgs{
 	GitVersion:   AtLeast("2.38.0"),
 	SetupConfig: func(config *config.AppConfig) {
 		config.GetUserConfig().Git.MainBranches = []string{"master"}
+		config.UserConfig.Git.Log.ShowGraph = "never"
 	},
 	SetupRepo: func(shell *Shell) {
 		shell.
diff --git a/pkg/integration/tests/interactive_rebase/quick_start_keep_selection.go b/pkg/integration/tests/interactive_rebase/quick_start_keep_selection.go
index 4589d010d9c..82d07ce2a0c 100644
--- a/pkg/integration/tests/interactive_rebase/quick_start_keep_selection.go
+++ b/pkg/integration/tests/interactive_rebase/quick_start_keep_selection.go
@@ -12,6 +12,7 @@ var QuickStartKeepSelection = NewIntegrationTest(NewIntegrationTestArgs{
 	GitVersion:   AtLeast("2.38.0"),
 	SetupConfig: func(config *config.AppConfig) {
 		config.GetUserConfig().Git.MainBranches = []string{"master"}
+		config.UserConfig.Git.Log.ShowGraph = "never"
 	},
 	SetupRepo: func(shell *Shell) {
 		shell.
diff --git a/pkg/integration/tests/interactive_rebase/quick_start_keep_selection_range.go b/pkg/integration/tests/interactive_rebase/quick_start_keep_selection_range.go
index 1b1039cf739..ec31735041a 100644
--- a/pkg/integration/tests/interactive_rebase/quick_start_keep_selection_range.go
+++ b/pkg/integration/tests/interactive_rebase/quick_start_keep_selection_range.go
@@ -12,6 +12,7 @@ var QuickStartKeepSelectionRange = NewIntegrationTest(NewIntegrationTestArgs{
 	GitVersion:   AtLeast("2.38.0"),
 	SetupConfig: func(config *config.AppConfig) {
 		config.GetUserConfig().Git.MainBranches = []string{"master"}
+		config.UserConfig.Git.Log.ShowGraph = "never"
 	},
 	SetupRepo: func(shell *Shell) {
 		shell.
diff --git a/pkg/integration/tests/reflog/do_not_show_branch_markers_in_reflog_subcommits.go b/pkg/integration/tests/reflog/do_not_show_branch_markers_in_reflog_subcommits.go
index 8e888c95aa2..b27b9731608 100644
--- a/pkg/integration/tests/reflog/do_not_show_branch_markers_in_reflog_subcommits.go
+++ b/pkg/integration/tests/reflog/do_not_show_branch_markers_in_reflog_subcommits.go
@@ -9,7 +9,9 @@ var DoNotShowBranchMarkersInReflogSubcommits = NewIntegrationTest(NewIntegration
 	Description:  "Verify that no branch heads are shown in the subcommits view of a reflog entry",
 	ExtraCmdArgs: []string{},
 	Skip:         false,
-	SetupConfig:  func(config *config.AppConfig) {},
+	SetupConfig: func(config *config.AppConfig) {
+		config.UserConfig.Git.Log.ShowGraph = "never"
+	},
 	SetupRepo: func(shell *Shell) {
 		shell.NewBranch("branch1")
 		shell.EmptyCommit("one")