summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f56782a)
raw | patch | inline | side by side (parent: f56782a)
author | Paul Mackerras <paulus@samba.org> | |
Fri, 14 Sep 2007 23:33:39 +0000 (09:33 +1000) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Fri, 14 Sep 2007 23:33:39 +0000 (09:33 +1000) |
Now that we have a general-purpose way of taking some action when a
commit ID of interest is encountered, use that for triggering the
git diff-index process when we find the currently checked-out head,
rather than the special-purpose lookingforhead variable.
Also do the commitinterest processing in getcommitlines rather than
in showstuff.
Signed-off-by: Paul Mackerras <paulus@samba.org>
commit ID of interest is encountered, use that for triggering the
git diff-index process when we find the currently checked-out head,
rather than the special-purpose lookingforhead variable.
Also do the commitinterest processing in getcommitlines rather than
in showstuff.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index fd6bbab3ed53907bc69d194ba081e1d90ba53964..85d33abf4abc26276b9af06a9e89851f5f159592 100755 (executable)
--- a/gitk
+++ b/gitk
global startmsecs
global commfd leftover tclencoding datemode
global viewargs viewfiles commitidx viewcomplete vnextroot
- global lookingforhead showlocalchanges
+ global showlocalchanges commitinterest mainheadid
set startmsecs [clock clicks -milliseconds]
set commitidx($view) 0
}
set commfd($view) $fd
set leftover($view) {}
- set lookingforhead $showlocalchanges
+ if {$showlocalchanges} {
+ lappend commitinterest($mainheadid) {dodiffindex}
+ }
fconfigure $fd -blocking 0 -translation lf -eofchar {}
if {$tclencoding != {}} {
fconfigure $fd -encoding $tclencoding
}
proc getcommitlines {fd view} {
- global commitlisted
+ global commitlisted commitinterest
global leftover commfd
global displayorder commitidx viewcomplete commitrow commitdata
global parentlist children curview hlview
lappend vdisporder($view) $id
lappend vcmitlisted($view) $listed
}
+ if {[info exists commitinterest($id)]} {
+ foreach script $commitinterest($id) {
+ eval [string map [list "%I" $id] $script]
+ }
+ unset commitinterest($id)
+ }
set gotsome 1
}
if {$gotsome} {
proc showstuff {canshow last} {
global numcommits commitrow pending_select selectedline curview
- global lookingforhead mainheadid displayorder selectfirst
+ global mainheadid displayorder selectfirst
global lastscrollset commitinterest
if {$numcommits == 0} {
set phase "incrdraw"
allcanvs delete all
}
- for {set l $numcommits} {$l < $canshow} {incr l} {
- set id [lindex $displayorder $l]
- if {[info exists commitinterest($id)]} {
- foreach script $commitinterest($id) {
- eval [string map [list "%I" $id] $script]
- }
- unset commitinterest($id)
- }
- }
set r0 $numcommits
set prev $numcommits
set numcommits $canshow
set selectfirst 0
}
}
- if {$lookingforhead && [info exists commitrow($curview,$mainheadid)]
- && ($last || $commitrow($curview,$mainheadid) < $numcommits - 1)} {
- set lookingforhead 0
- dodiffindex
- }
}
proc doshowlocalchanges {} {
- global lookingforhead curview mainheadid phase commitrow
+ global curview mainheadid phase commitrow
if {[info exists commitrow($curview,$mainheadid)] &&
($phase eq {} || $commitrow($curview,$mainheadid) < $numcommits - 1)} {
dodiffindex
} elseif {$phase ne {}} {
- set lookingforhead 1
+ lappend commitinterest($mainheadid) {}
}
}
proc dohidelocalchanges {} {
- global lookingforhead localfrow localirow lserial
+ global localfrow localirow lserial
- set lookingforhead 0
if {$localfrow >= 0} {
removerow $localfrow
set localfrow -1
# spawn off a process to do git diff-index --cached HEAD
proc dodiffindex {} {
- global localirow localfrow lserial
+ global localirow localfrow lserial showlocalchanges
+ if {!$showlocalchanges} return
incr lserial
set localfrow -1
set localirow -1
proc resethead {} {
global mainheadid mainhead rowmenuid confirm_ok resettype
- global showlocalchanges
set confirm_ok 0
set w ".confirmreset"
set stopped 0
set stuffsaved 0
set patchnum 0
-set lookingforhead 0
set localirow -1
set localfrow -1
set lserial 0