summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorLay <lei4519@126.com>2022-05-30 13:52:39 +0800
committerLay <lei4519@126.com>2022-05-30 13:52:39 +0800
commit666180cfd02f7ff69faa7425caa5eef358955827 (patch)
treea1d595e2cfc7dadfbf7d69baf7e3c8a918dbbdd0 /pkg
parent8fd9dea6414a9b35af5b173854f90275229a460a (diff)
Add config param that displays the whole git graph by default
Diffstat (limited to 'pkg')
-rw-r--r--pkg/config/user_config.go2
-rw-r--r--pkg/gui/context/local_commits_context.go5
2 files changed, 5 insertions, 2 deletions
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