summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ac1276a)
raw | patch | inline | side by side (parent: ac1276a)
author | Paul Mackerras <paulus@samba.org> | |
Sun, 2 Mar 2008 23:19:35 +0000 (10:19 +1100) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Sun, 2 Mar 2008 23:19:35 +0000 (10:19 +1100) |
Previously we passed the arguments indicating what commits the user
wants to view through git rev-parse to get a list of IDs (positive and
negative), then gave that to git log. This had a couple of problems,
notably that --merge and --left-right didn't get handled properly.
Instead we now just pass the original arguments to git log. When doing
an update, we append --not followed by the list of commits we have seen
that have no children, since we have got (or will get) their ancestors
from the first git log. If the first git log isn't finished yet, we
might get some duplicates from the second git log, but that doesn't
cause any problem.
Also get rid of the unused vnextroot variable.
Signed-off-by: Paul Mackerras <paulus@samba.org>
wants to view through git rev-parse to get a list of IDs (positive and
negative), then gave that to git log. This had a couple of problems,
notably that --merge and --left-right didn't get handled properly.
Instead we now just pass the original arguments to git log. When doing
an update, we append --not followed by the list of commits we have seen
that have no children, since we have got (or will get) their ancestors
from the first git log. If the first git log isn't finished yet, we
might get some duplicates from the second git log, but that doesn't
cause any problem.
Also get rid of the unused vnextroot variable.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 47e1a58d63ec4c5773906293b444f6c3db58df0e..17f889d26dcf575000ecadd4ea970bc40e6f9c12 100755 (executable)
--- a/gitk
+++ b/gitk
proc start_rev_list {view} {
global startmsecs
global commfd leftover tclencoding datemode
- global viewargs viewfiles commitidx viewcomplete vnextroot
+ global viewargs viewfiles commitidx viewcomplete
global showlocalchanges commitinterest mainheadid
global progressdirn progresscoords proglastnc curview
- global viewincl viewactive loginstance viewinstances
+ global viewactive loginstance viewinstances
global pending_select mainheadid
set startmsecs [clock clicks -milliseconds]
set commitidx($view) 0
set viewcomplete($view) 0
set viewactive($view) 1
- set vnextroot($view) 0
varcinit $view
- set commits [eval exec git rev-parse --default HEAD --revs-only \
- $viewargs($view)]
- set viewincl($view) {}
- foreach c $commits {
- if {[regexp {^[0-9a-fA-F]{40}$} $c]} {
- lappend viewincl($view) $c
- }
- }
if {[catch {
set fd [open [concat | git log --no-color -z --pretty=raw --parents \
- --boundary $commits "--" $viewfiles($view)] r]
+ --boundary $viewargs($view) "--" $viewfiles($view)] r]
} err]} {
error_popup "[mc "Error executing git log:"] $err"
exit 1
}
proc updatecommits {} {
- global curview viewargs viewfiles viewincl viewinstances
+ global curview viewargs viewfiles viewinstances
global viewactive viewcomplete loginstance tclencoding mainheadid
- global varcid startmsecs commfd showneartags showlocalchanges leftover
+ global startmsecs commfd showneartags showlocalchanges leftover
global mainheadid pending_select
set oldmainid $mainheadid
}
}
set view $curview
- set commits [exec git rev-parse --default HEAD --revs-only \
- $viewargs($view)]
- set pos {}
- set neg {}
- set flags {}
- foreach c $commits {
- if {[string match "^*" $c]} {
- lappend neg $c
- } elseif {[regexp {^[0-9a-fA-F]{40}$} $c]} {
- if {!([info exists varcid($view,$c)] ||
- [lsearch -exact $viewincl($view) $c] >= 0)} {
- lappend pos $c
- }
- } else {
- lappend flags $c
- }
- }
- if {$pos eq {}} {
- return
- }
- foreach id $viewincl($view) {
- lappend neg "^$id"
- }
- set viewincl($view) [concat $viewincl($view) $pos]
if {[catch {
set fd [open [concat | git log --no-color -z --pretty=raw --parents \
- --boundary $pos $neg $flags "--" $viewfiles($view)] r]
+ --boundary $viewargs($view) --not [seeds $view] \
+ "--" $viewfiles($view)] r]
} err]} {
error_popup "Error executing git log: $err"
exit 1
catch {unset ordertok}
}
+# returns a list of the commits with no children
+proc seeds {v} {
+ global vdownptr vleftptr varcstart
+
+ set ret {}
+ set a [lindex $vdownptr($v) 0]
+ while {$a != 0} {
+ lappend ret [lindex $varcstart($v) $a]
+ set a [lindex $vleftptr($v) $a]
+ }
+ return $ret
+}
+
proc newvarc {view id} {
global varcid varctok parents children datemode
global vupptr vdownptr vleftptr vbackptr varcrow varcix varcstart
global cmitlisted commitinterest leftover
global commitidx commitdata datemode
global parents children curview hlview
- global vnextroot idpending ordertok
+ global idpending ordertok
global varccommits varcid varctok vtokmod viewfiles
set stuff [read $fd 500000]
}
proc cherrypick {} {
- global rowmenuid curview viewincl
+ global rowmenuid curview
global mainhead mainheadid
set oldhead [exec git rev-parse HEAD]
movedhead $newhead $mainhead
set mainheadid $newhead
}
- # remove oldhead from viewincl and add newhead
- set i [lsearch -exact $viewincl($curview) $oldhead]
- if {$i >= 0} {
- set viewincl($curview) [lreplace $viewincl($curview) $i $i]
- }
- lappend viewincl($curview) $newhead
redrawtags $oldhead
redrawtags $newhead
selbyid $newhead