summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4539eac)
raw | patch | inline | side by side (parent: 4539eac)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sat, 18 Nov 2006 08:03:16 +0000 (03:03 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sat, 18 Nov 2006 08:03:16 +0000 (03:03 -0500) |
I noticed that we were reshowing the current diff during a commit;
this occurs because we feed every added and modified file through
update-index just before commit. During the update-index process
we reshow the current diff if the current file in the diff pane
was one of those added or modified files we reprocessed. This
just slows down the UI more than is necessary.
So refactoring update_index so that we don't call reshow_diff
from within that code; instead we do it at a higher level.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
this occurs because we feed every added and modified file through
update-index just before commit. During the update-index process
we reshow the current diff if the current file in the diff pane
was one of those added or modified files we reprocessed. This
just slows down the UI more than is necessary.
So refactoring update_index so that we don't call reshow_diff
from within that code; instead we do it at a higher level.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | patch | blob | history |
index e2e0beae95004f2bdcc09e79a59fd5dd2c84d242..62545b70945bad20779409c2cd2889c561735c0d 100755 (executable)
--- a/git-gui
+++ b/git-gui
}
proc update_index {msg pathList after} {
- global update_index_cp update_index_rsd ui_status_value
+ global update_index_cp ui_status_value
if {![lock_index update]} return
set update_index_cp 0
- set update_index_rsd 0
set pathList [lsort $pathList]
set totalCnt [llength $pathList]
set batch [expr {int($totalCnt * .01) + 1}]
}
proc write_update_index {fd pathList totalCnt batch msg after} {
- global update_index_cp update_index_rsd ui_status_value
+ global update_index_cp ui_status_value
global file_states current_diff
if {$update_index_cp >= $totalCnt} {
close $fd
unlock_index
- if {$update_index_rsd} reshow_diff
uplevel #0 $after
return
}
puts -nonewline $fd $path
puts -nonewline $fd "\0"
display_file $path $new
- if {$current_diff eq $path} {
- set update_index_rsd 1
- }
}
set ui_status_value [format \
}
proc do_include_all {} {
- global file_states
+ global file_states current_diff
if {![lock_index begin-update]} return
set pathList [list]
+ set after {}
foreach path [array names file_states] {
- set s $file_states($path)
- set m [lindex $s 0]
- switch -- $m {
+ switch -- [lindex $file_states($path) 0] {
AM -
MM -
_M -
- _D {lappend pathList $path}
+ _D {
+ lappend pathList $path
+ if {$path eq $current_diff} {
+ set after {reshow_diff;}
+ }
+ }
}
}
if {$pathList eq {}} {
update_index \
"Including all modified files" \
$pathList \
- {set ui_status_value {Ready to commit.}}
+ [concat $after {set ui_status_value {Ready to commit.}}]
}
}
}
proc toggle_or_diff {w x y} {
- global file_lists ui_index ui_other
+ global file_lists current_diff ui_index ui_other
global last_clicked selected_paths
set pos [split [$w index @$x,$y] .]
$ui_other tag remove in_sel 0.0 end
if {$col == 0} {
+ if {$current_diff eq $path} {
+ set after {reshow_diff;}
+ } else {
+ set after {}
+ }
update_index \
"Including [short_path $path]" \
[list $path] \
- {set ui_status_value {Ready.}}
+ [concat $after {set ui_status_value {Ready.}}]
} else {
show_diff $path $w $lno
}
# -- Diff Header
set current_diff {}
set diff_actions [list]
-proc current_diff_trace {varname args} {
+proc trace_current_diff {varname args} {
global current_diff diff_actions file_states
if {$current_diff eq {}} {
set s {}
uplevel #0 $w $o
}
}
-trace add variable current_diff write current_diff_trace
+trace add variable current_diff write trace_current_diff
frame .vpane.lower.diff.header -background orange
label .vpane.lower.diff.header.status \