summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Kiraly <kiraly@disi.unitn.it>2014-12-15 15:38:00 (GMT)
committerPat Thoyts <patthoyts@users.sourceforge.net>2015-01-05 16:13:25 (GMT)
commita117fa211671b01449c81c7aed6766e55cb55c38 (patch)
tree0f176b4ea00724540d444688065371ec35f635d0
parentcdc6aba8c52af4ac4338a1e9fb1028ca3337a5e3 (diff)
downloadgit-a117fa211671b01449c81c7aed6766e55cb55c38.zip
git-a117fa211671b01449c81c7aed6766e55cb55c38.tar.gz
git-a117fa211671b01449c81c7aed6766e55cb55c38.tar.bz2
git-gui: fix problem with gui.maxfilesdisplayed
gui.maxfilesdisplayed (added in dd6451f9c7c5a36d3006231b618ac6da06c7c7b4) was applied brute force on the file list in alphabetic order. As a result, files that had modifications might not be displayed by git-gui. Even worse, files that are already in the index might not be displayed, which makes git-gui hard to use in some workflows. This fix changes the meaning of gui.maxfilesdisplayed, making it a soft limit that only applies to "_O" files, i.e. files that are "Untracked, not staged". Signed-off-by: Csaba Kiraly <kiraly@disi.unitn.it> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
-rwxr-xr-xgit-gui.sh21
1 files changed, 12 insertions, 9 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 27ce0e3..0e4b05a 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1965,20 +1965,22 @@ proc display_all_files {} {
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}]]
- }
+ set displayed 0
foreach path $to_display {
set s $file_states($path)
set m [lindex $s 0]
set icon_name [lindex $s 1]
+ if {$displayed > $display_limit && [string index $m 1] eq {O} } {
+ if {!$files_warning} {
+ # do not repeatedly warn:
+ set files_warning 1
+ info_popup [mc "Display limit (gui.maxfilesdisplayed = %s) reached, not showing all %s files." \
+ $display_limit [llength $to_display]]
+ }
+ continue
+ }
+
set s [string index $m 0]
if {$s ne {U} && $s ne {_}} {
display_all_files_helper $ui_index $path \
@@ -1993,6 +1995,7 @@ proc display_all_files {} {
if {$s ne {_}} {
display_all_files_helper $ui_workdir $path \
$icon_name $s
+ incr displayed
}
}