summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2112be7)
raw | patch | inline | side by side (parent: 2112be7)
author | Dan Zwell <dzwell@zwell.net> | |
Tue, 11 Aug 2009 18:50:00 +0000 (13:50 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 12 Aug 2009 14:41:52 +0000 (07:41 -0700) |
When there is a large number of new or modified files,
"display_all_files" takes a long time, and git-gui appears to hang.
This change limits the number of files that are displayed. This
limit can be set as gui.maxfilesdisplayed, and is 5000 by default.
A warning is shown the first time the list of files is truncated
in this GUI session. Subsequent truncations are not mentioned to
the user.
Signed-off-by: Dan Zwell <dzwell@zwell.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
"display_all_files" takes a long time, and git-gui appears to hang.
This change limits the number of files that are displayed. This
limit can be set as gui.maxfilesdisplayed, and is 5000 by default.
A warning is shown the first time the list of files is truncated
in this GUI session. Subsequent truncations are not mentioned to
the user.
Signed-off-by: Dan Zwell <dzwell@zwell.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh | patch | blob | history | |
po/git-gui.pot | patch | blob | history |
diff --git a/git-gui.sh b/git-gui.sh
index 3c0ce2602987c5ca04acbde27a021a0009917d6b..eae1f8121d6c8af4f5673dd26039d0eafcfd8666 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
set default_config(gui.spellingdictionary) {}
set default_config(gui.fontui) [font configure font_ui]
set default_config(gui.fontdiff) [font configure font_diff]
+# TODO: this option should be added to the git-config documentation
+set default_config(gui.maxfilesdisplayed) 5000
set font_descs {
{fontui font_ui {mc "Main Font"}}
{fontdiff font_diff {mc "Diff/Console Font"}}
$w insert end "[escape_path $path]\n"
}
+set files_warning 0
proc display_all_files {} {
global ui_index ui_workdir
global file_states file_lists
global last_clicked
+ global files_warning
$ui_index conf -state normal
$ui_workdir conf -state normal
set file_lists($ui_index) [list]
set file_lists($ui_workdir) [list]
- foreach path [lsort [array names file_states]] {
+ set to_display [lsort [array names file_states]]
+ set display_limit [get_config gui.maxfilesdisplayed]
+ if {[llength $to_display] > $display_limit} {
+ if {!$files_warning} {
+ # do not repeatedly warn:
+ set files_warning 1
+ info_popup [mc "Displaying only %s of %s files." \
+ $display_limit [llength $to_display]]
+ }
+ set to_display [lrange $to_display 0 [expr {$display_limit-1}]]
+ }
+ foreach path $to_display {
set s $file_states($path)
set m [lindex $s 0]
set icon_name [lindex $s 1]
diff --git a/po/git-gui.pot b/po/git-gui.pot
index 53b7d3634d842a43f8043e3f825d4232e17588aa..074582d979e87704969ebdd2380566537c6a9548 100644 (file)
--- a/po/git-gui.pot
+++ b/po/git-gui.pot
msgid "Ready."
msgstr ""
+#: git-gui.sh:1726
+#, tcl-format
+msgid "Displaying only %s of %s files."
+msgstr ""
+
#: git-gui.sh:1819
msgid "Unmodified"
msgstr ""