summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f7b9f6e)
raw | patch | inline | side by side (parent: f7b9f6e)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 21 Jan 2007 02:23:21 +0000 (21:23 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 21 Jan 2007 07:54:20 +0000 (02:54 -0500) |
Users often forget to repack their object database, then start to
complain about how slow it is to perform common operations after
they have collected thousands of loose objects in their objects
directory. A simple repack usually restores performance.
During startup git-gui now asks git-count-objects how many loose
objects exist, and if this number exceeds a hardcoded threshold
we suggest that the user compress the database (aka run 'git gc')
at this time. I've hardcoded this to 2000 objects on non-Windows
systems as there the filesystems tend to handle the ~8 objects
per directory just fine. On Windows NTFS and FAT are just so slow
that we really start to lag when more than 200 loose objects exist,
so the hardcoded threshold is much lower there.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
complain about how slow it is to perform common operations after
they have collected thousands of loose objects in their objects
directory. A simple repack usually restores performance.
During startup git-gui now asks git-count-objects how many loose
objects exist, and if this number exceeds a hardcoded threshold
we suggest that the user compress the database (aka run 'git gc')
at this time. I've hardcoded this to 2000 objects on non-Windows
systems as there the filesystems tend to handle the ~8 objects
per directory just fine. On Windows NTFS and FAT are just so slow
that we really start to lag when more than 200 loose objects exist,
so the hardcoded threshold is much lower there.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh | patch | blob | history |
diff --git a/git-gui.sh b/git-gui.sh
index e2dc931e4889ef2ba16bb080562ef14eeacf8a74..fb2d92d17c020a98d803c8135611d695790eb89d 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
-message $msg
}
+proc ask_popup {msg} {
+ global gitdir appname
+
+ set title $appname
+ if {$gitdir ne {}} {
+ append title { (}
+ append title [lindex \
+ [file split [file normalize [file dirname $gitdir]]] \
+ end]
+ append title {)}
+ }
+ return [tk_messageBox \
+ -parent . \
+ -icon question \
+ -type yesno \
+ -title $title \
+ -message $msg]
+}
+
######################################################################
##
## repository setup
populate_push_menu .mbar.push
}
+# -- Only suggest a gc run if we are going to stay running.
+#
+if {!$single_commit} {
+ set object_limit 2000
+ if {[is_Windows]} {set object_limit 200}
+ regexp {^([0-9]+) objects,} [exec git count-objects] _junk objects_current
+ if {$objects_current >= $object_limit} {
+ if {[ask_popup \
+ "This repository currently has $objects_current loose objects.
+
+To maintain optimal performance it is strongly
+recommended that you compress the database
+when more than $object_limit loose objects exist.
+
+Compress the database now?"] eq yes} {
+ do_gc
+ }
+ }
+ unset object_limit _junk objects_current
+}
+
lock_index begin-read
after 1 do_rescan