summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 043f701)
raw | patch | inline | side by side (parent: 043f701)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 12 Nov 2006 23:22:59 +0000 (18:22 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 13 Nov 2006 05:10:39 +0000 (00:10 -0500) |
We can't ask the diff viewer to recompute the diff until after our
update-index child process terminates, as the diff programs need to
be able to read the updated index in order to generate the correct
diff. This is actually why we prevent diffs from being generated
while there is an update lock on the index, which is why we ignored
our own show_diff invocation in the middle of the write_update_index
event handler.
So now we mark a flag if we identify that the file currently in the
diff viewer was also sent to update-index; then later when the
update-index process has terminated we update the diff viewer if
the flag is true.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
update-index child process terminates, as the diff programs need to
be able to read the updated index in order to generate the correct
diff. This is actually why we prevent diffs from being generated
while there is an update lock on the index, which is why we ignored
our own show_diff invocation in the middle of the write_update_index
event handler.
So now we mark a flag if we identify that the file currently in the
diff viewer was also sent to update-index; then later when the
update-index process has terminated we update the diff viewer if
the flag is true.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | patch | blob | history |
index 05ef8e2e336d8f0d522bc7fcd615817f2c643406..fdb82812bd14304ae78ae5c66ef4f6572f509f4f 100755 (executable)
--- a/git-gui
+++ b/git-gui
}
proc update_index {pathList} {
- global update_index_cp ui_status_value
+ global update_index_cp update_index_rsd ui_status_value
if {![lock_index update]} return
set update_index_cp 0
+ set update_index_rsd 0
set totalCnt [llength $pathList]
set batch [expr {int($totalCnt * .01) + 1}]
if {$batch > 25} {set batch 25}
}
proc write_update_index {fd pathList totalCnt batch} {
- global update_index_cp ui_status_value
+ global update_index_cp update_index_rsd ui_status_value
global file_states ui_fname_value
if {$update_index_cp >= $totalCnt} {
close $fd
unlock_index
- set ui_status_value {Ready.}
+ if {$update_index_rsd} {
+ show_diff $ui_fname_value
+ } else {
+ set ui_status_value {Ready.}
+ }
return
}
puts -nonewline $fd "\0"
display_file $path $new
if {$ui_fname_value eq $path} {
- show_diff $path
+ set update_index_rsd 1
}
}