Browse Source

[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>
maint
Linus Torvalds 17 years ago committed by Paul Mackerras
parent
commit
1407ade93c
  1. 15
      gitk

15
gitk

@ -240,11 +240,12 @@ proc getcommitlines {fd view} {
set listed 1 set listed 1
if {$j >= 0 && [string match "commit *" $cmit]} { if {$j >= 0 && [string match "commit *" $cmit]} {
set ids [string range $cmit 7 [expr {$j - 1}]] set ids [string range $cmit 7 [expr {$j - 1}]]
if {[string match {[-<>]*} $ids]} { if {[string match {[-^<>]*} $ids]} {
switch -- [string index $ids 0] { switch -- [string index $ids 0] {
"-" {set listed 0} "-" {set listed 0}
"<" {set listed 2} "^" {set listed 2}
">" {set listed 3} "<" {set listed 3}
">" {set listed 4}
} }
set ids [string range $ids 1 end] set ids [string range $ids 1 end]
} }
@ -3631,23 +3632,23 @@ proc drawcmittext {id row col} {
global linehtag linentag linedtag selectedline global linehtag linentag linedtag selectedline
global canvxmax boldrows boldnamerows fgcolor nullid nullid2 global canvxmax boldrows boldnamerows fgcolor nullid nullid2


# listed is 0 for boundary, 1 for normal, 2 for left, 3 for right # listed is 0 for boundary, 1 for normal, 2 for negative, 3 for left, 4 for right
set listed [lindex $commitlisted $row] set listed [lindex $commitlisted $row]
if {$id eq $nullid} { if {$id eq $nullid} {
set ofill red set ofill red
} elseif {$id eq $nullid2} { } elseif {$id eq $nullid2} {
set ofill green set ofill green
} else { } else {
set ofill [expr {$listed != 0? "blue": "white"}] set ofill [expr {$listed != 0 ? $listed == 2 ? "gray" : "blue" : "white"}]
} }
set x [xc $row $col] set x [xc $row $col]
set y [yc $row] set y [yc $row]
set orad [expr {$linespc / 3}] set orad [expr {$linespc / 3}]
if {$listed <= 1} { if {$listed <= 2} {
set t [$canv create oval [expr {$x - $orad}] [expr {$y - $orad}] \ set t [$canv create oval [expr {$x - $orad}] [expr {$y - $orad}] \
[expr {$x + $orad - 1}] [expr {$y + $orad - 1}] \ [expr {$x + $orad - 1}] [expr {$y + $orad - 1}] \
-fill $ofill -outline $fgcolor -width 1 -tags circle] -fill $ofill -outline $fgcolor -width 1 -tags circle]
} elseif {$listed == 2} { } elseif {$listed == 3} {
# triangle pointing left for left-side commits # triangle pointing left for left-side commits
set t [$canv create polygon \ set t [$canv create polygon \
[expr {$x - $orad}] $y \ [expr {$x - $orad}] $y \

Loading…
Cancel
Save