[RFC PATCH 8/8] git gui: make gc hint and fetch on startup sequential
On large repositories (especially on Windows) doing any harddrive usage
during the initial status scan slows the whole process down. So this
postpones the question for compressing loose objects and fetching of the
default remote until after that.
---
git-gui/git-gui.sh | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 3e3c7cd..19b1ad6 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -2031,8 +2031,22 @@ proc do_quit {{rc {1}}} {
destroy .
}
+proc ui_finalize_startup {} {
+ global repo_config
+
+ set defaultremote $repo_config(gui.defaultremote)
+ if {[is_config_true gui.fetchonstartup] && $defaultremote ne {}} {
+ fetch_from $defaultremote {close_on_success}
+ }
+
+ if {[is_enabled multicommit]} {
+ hint_gc
+ }
+ ui_ready
+}
+
proc do_rescan {} {
- rescan ui_ready
+ rescan ui_finalize_startup
}
proc ui_do_rescan {} {
@@ -3502,14 +3516,6 @@ after 1 {
}
}
-set defaultremote $repo_config(gui.defaultremote)
-if {[is_config_true gui.fetchonstartup] && $defaultremote ne {}} {
- after 500 {fetch_from $defaultremote {close_on_success}}
-}
-
-if {[is_enabled multicommit]} {
- after 1000 hint_gc
-}
if {[is_enabled retcode]} {
bind . <Destroy> {+terminate_me %W}
}
--
1.6.5.rc1.12.gc72fe