[BUG/PATCH] Revert "gitk: Arrange to kill diff-files & diff-index on quit"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This reverts commit e439e092b8ee5248e92ed4cb4400f9dbed70f689.

gitk would not show diffs (or trees when choosing tree view) about
half of the times it is started, it would only show the commit
messages. Sometimes it took dozens of times to get it to show a diff
again with 3 starts, then the next 2 starts not, then the next 2
starts would show it again, and so on.

Conflicts:

	gitk-git/gitk

Signed-off-by: Christian Jaeger <christian@xxxxxxxxxxxxxx>
---

This is fixing the problem for 1.6.0-rc2.

I've found the culprit with bisect, running gitk directly from the
source tree witout installation (meaning that it probably used the
1.6.0-rc2 git tools throughout the whole bisect run).

My system environment:
  Debian Lenny (testing)
  tk8.4 8.4.19-2

Thanks,
Christian.


 gitk-git/gitk |   41 +++++++++++++++++------------------------
 1 files changed, 17 insertions(+), 24 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index d093a39..5b6ab7e 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -90,15 +90,6 @@ proc dorunq {} {
     }
 }
 
-proc reg_instance {fd} {
-    global commfd leftover loginstance
-
-    set i [incr loginstance]
-    set commfd($i) $fd
-    set leftover($i) {}
-    return $i
-}
-
 proc unmerged_files {files} {
     global nr_unmerged
 
@@ -303,11 +294,11 @@ proc parseviewrevs {view revs} {
 # Start off a git log process and arrange to read its output
 proc start_rev_list {view} {
     global startmsecs commitidx viewcomplete curview
-    global tclencoding
+    global commfd leftover tclencoding
     global viewargs viewargscmd viewfiles vfilelimit
     global showlocalchanges commitinterest
-    global viewactive viewinstances vmergeonly
-    global mainheadid
+    global viewactive loginstance viewinstances vmergeonly
+    global pending_select mainheadid
     global vcanopt vflags vrevs vorigargs
 
     set startmsecs [clock clicks -milliseconds]
@@ -363,8 +354,10 @@ proc start_rev_list {view} {
 	error_popup "[mc "Error executing git log:"] $err"
 	return 0
     }
-    set i [reg_instance $fd]
+    set i [incr loginstance]
     set viewinstances($view) [list $i]
+    set commfd($i) $fd
+    set leftover($i) {}
     if {$showlocalchanges && $mainheadid ne {}} {
 	lappend commitinterest($mainheadid) {dodiffindex}
     }
@@ -440,8 +433,8 @@ proc getcommits {selid} {
 
 proc updatecommits {} {
     global curview vcanopt vorigargs vfilelimit viewinstances
-    global viewactive viewcomplete tclencoding
-    global startmsecs showneartags showlocalchanges
+    global viewactive viewcomplete loginstance tclencoding
+    global startmsecs commfd showneartags showlocalchanges leftover
     global mainheadid pending_select
     global isworktree
     global varcid vposids vnegids vflags vrevs
@@ -502,8 +495,10 @@ proc updatecommits {} {
     if {$viewactive($view) == 0} {
 	set startmsecs [clock clicks -milliseconds]
     }
-    set i [reg_instance $fd]
+    set i [incr loginstance]
     lappend viewinstances($view) $i
+    set commfd($i) $fd
+    set leftover($i) {}
     fconfigure $fd -blocking 0 -translation lf -eofchar {}
     if {$tclencoding != {}} {
 	fconfigure $fd -encoding $tclencoding
@@ -4091,11 +4086,10 @@ proc dodiffindex {} {
     incr lserial
     set fd [open "|git diff-index --cached HEAD" r]
     fconfigure $fd -blocking 0
-    set i [reg_instance $fd]
-    filerun $fd [list readdiffindex $fd $lserial $i]
+    filerun $fd [list readdiffindex $fd $lserial]
 }
 
-proc readdiffindex {fd serial inst} {
+proc readdiffindex {fd serial} {
     global mainheadid nullid nullid2 curview commitinfo commitdata lserial
 
     set isdiff 1
@@ -4106,7 +4100,7 @@ proc readdiffindex {fd serial inst} {
 	set isdiff 0
     }
     # we only need to see one line and we don't really care what it says...
-    stop_instance $inst
+    close $fd
 
     if {$serial != $lserial} {
 	return 0
@@ -4115,8 +4109,7 @@ proc readdiffindex {fd serial inst} {
     # now see if there are any local changes not checked in to the index
     set fd [open "|git diff-files" r]
     fconfigure $fd -blocking 0
-    set i [reg_instance $fd]
-    filerun $fd [list readdifffiles $fd $serial $i]
+    filerun $fd [list readdifffiles $fd $serial]
 
     if {$isdiff && ![commitinview $nullid2 $curview]} {
 	# add the line for the changes in the index to the graph
@@ -4133,7 +4126,7 @@ proc readdiffindex {fd serial inst} {
     return 0
 }
 
-proc readdifffiles {fd serial inst} {
+proc readdifffiles {fd serial} {
     global mainheadid nullid nullid2 curview
     global commitinfo commitdata lserial
 
@@ -4145,7 +4138,7 @@ proc readdifffiles {fd serial inst} {
 	set isdiff 0
     }
     # we only need to see one line and we don't really care what it says...
-    stop_instance $inst
+    close $fd
 
     if {$serial != $lserial} {
 	return 0
-- 
1.6.0.rc2.1.g42d19

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux