@matheusbsbs / matheus-bagliano / commits / 1407ade93c
Fork 0

[PATCH] gitk: learn --show-all output

It's really not very easy to visualize the commit walker, because - on purpose - it obvously doesn't show the uninteresting commits! We will soon add a "--show-all" flag to the revision walker, which will make it show uninteresting commits too, and they'll have a '^' in front of them. This is to update 'gitk' to show those negative commits in gray to futureproof it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Paul Mackerras <paulus@samba.org>

Linus Torvalds committed Feb 9, 2008 at 14:02 UTC 1407ade93cc1c58d520c2a0f509152ba27b594e8
1 file changed +8 -7
gitk
+8 -7
@@ -240,11 +240,12 @@ proc getcommitlines {fd view} {
240 set listed 1
241 if {$j >= 0 && [string match "commit *" $cmit]} {
242 set ids [string range $cmit 7 [expr {$j - 1}]]
243 - if {[string match {[-<>]*} $ids]} {
243 + if {[string match {[-^<>]*} $ids]} {
244 switch -- [string index $ids 0] {
245 "-" {set listed 0}
246 - "<" {set listed 2}
247 - ">" {set listed 3}
246 + "^" {set listed 2}
247 + "<" {set listed 3}
248 + ">" {set listed 4}
249 }
250 set ids [string range $ids 1 end]
251 }
@@ -3631,23 +3632,23 @@ proc drawcmittext {id row col} {
3632 global linehtag linentag linedtag selectedline
3633 global canvxmax boldrows boldnamerows fgcolor nullid nullid2
3634
3634 - # listed is 0 for boundary, 1 for normal, 2 for left, 3 for right
3635 + # listed is 0 for boundary, 1 for normal, 2 for negative, 3 for left, 4 for right
3636 set listed [lindex $commitlisted $row]
3637 if {$id eq $nullid} {
3638 set ofill red
3639 } elseif {$id eq $nullid2} {
3640 set ofill green
3641 } else {
3641 - set ofill [expr {$listed != 0? "blue": "white"}]
3642 + set ofill [expr {$listed != 0 ? $listed == 2 ? "gray" : "blue" : "white"}]
3643 }
3644 set x [xc $row $col]
3645 set y [yc $row]
3646 set orad [expr {$linespc / 3}]
3646 - if {$listed <= 1} {
3647 + if {$listed <= 2} {
3648 set t [$canv create oval [expr {$x - $orad}] [expr {$y - $orad}] \
3649 [expr {$x + $orad - 1}] [expr {$y + $orad - 1}] \
3650 -fill $ofill -outline $fgcolor -width 1 -tags circle]
3650 - } elseif {$listed == 2} {
3651 + } elseif {$listed == 3} {
3652 # triangle pointing left for left-side commits
3653 set t [$canv create polygon \
3654 [expr {$x - $orad}] $y \