diff --git a/docs/Config.md b/docs/Config.md index 5e32f3605..11ddb4e1f 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -75,6 +75,8 @@ git: # one of always, never, when-maximised # this determines whether the git graph is rendered in the commits panel showGraph: 'when-maximised' + # displays the whole git graph by default in the commits panel + showWholeGraph: false skipHookPrefix: WIP autoFetch: true autoRefresh: true diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index 6ff3b36a1..1e42b0e15 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -106,6 +106,7 @@ type MergingConfig struct { type LogConfig struct { Order string `yaml:"order"` // one of date-order, author-date-order, topo-order ShowGraph string `yaml:"showGraph"` // one of always, never, when-maximised + ShowWholeGraph bool `yaml:"showWholeGraph"` } type CommitPrefixConfig struct { @@ -385,6 +386,7 @@ func GetDefaultConfig() *UserConfig { Log: LogConfig{ Order: "topo-order", ShowGraph: "when-maximised", + ShowWholeGraph: false, }, SkipHookPrefix: "WIP", AutoFetch: true, diff --git a/pkg/gui/context/local_commits_context.go b/pkg/gui/context/local_commits_context.go index 7432cab95..6653087c1 100644 --- a/pkg/gui/context/local_commits_context.go +++ b/pkg/gui/context/local_commits_context.go @@ -24,7 +24,7 @@ func NewLocalCommitsContext( c *types.HelperCommon, ) *LocalCommitsContext { - viewModel := NewLocalCommitsViewModel(getModel) + viewModel := NewLocalCommitsViewModel(getModel, c) return &LocalCommitsContext{ LocalCommitsViewModel: viewModel, @@ -70,10 +70,11 @@ type LocalCommitsViewModel struct { showWholeGitGraph bool } -func NewLocalCommitsViewModel(getModel func() []*models.Commit) *LocalCommitsViewModel { +func NewLocalCommitsViewModel(getModel func() []*models.Commit, c *types.HelperCommon) *LocalCommitsViewModel { self := &LocalCommitsViewModel{ BasicViewModel: NewBasicViewModel(getModel), limitCommits: true, + showWholeGitGraph: c.UserConfig.Git.Log.ShowWholeGraph, } return self