From 2d1c29fa765fed2b601c65cabdfb3327bb2fd543 Mon Sep 17 00:00:00 2001 From: Yuki Osaki Date: Mon, 1 Nov 2021 00:00:39 +0900 Subject: [PATCH] Add enableGhCommand flag --- docs/Config.md | 1 + pkg/config/user_config.go | 2 ++ pkg/gui/commits_panel.go | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/Config.md b/docs/Config.md index e62bcb2ea..151c3266e 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -68,6 +68,7 @@ git: overrideGpg: false # prevents lazygit from spawning a separate process when using GPG disableForcePushing: false parseEmoji: false + enableGhCommand: false os: editCommand: '' # see 'Configuring File Editing' section editCommandTemplate: '{{editor}} {{filename}}' diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index eddea3ba4..eafe21fa7 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -70,6 +70,7 @@ type GitConfig struct { DisableForcePushing bool `yaml:"disableForcePushing"` CommitPrefixes map[string]CommitPrefixConfig `yaml:"commitPrefixes"` ParseEmoji bool `yaml:"parseEmoji"` + EnableGhCommand bool `yaml:"enableGhCommand"` } type PagingConfig struct { @@ -345,6 +346,7 @@ func GetDefaultConfig() *UserConfig { DisableForcePushing: false, CommitPrefixes: map[string]CommitPrefixConfig(nil), ParseEmoji: false, + EnableGhCommand: false, }, Refresher: RefresherConfig{ RefreshInterval: 10, diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index c9dd5169a..aef59f462 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -72,7 +72,10 @@ func (gui *Gui) refreshReflogCommitsConsideringStartup() { }) go utils.Safe(func() { // The github cli can be quite slow so we load the github PRs sparately - gui.refreshGithubPullRequests() + if gui.Config.GetUserConfig().Git.EnableGhCommand { + gui.refreshGithubPullRequests() + } + wg.Wait() _ = gui.postRefreshUpdate(gui.State.Contexts.Branches) })