Skip to content

Commit 1407ade

Browse files
torvaldspaulusmack
authored andcommitted
[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>
1 parent 48750d6 commit 1407ade

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

gitk

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,12 @@ proc getcommitlines {fd view} {
240240
set listed 1
241241
if {$j >= 0 && [string match "commit *" $cmit]} {
242242
set ids [string range $cmit 7 [expr {$j - 1}]]
243-
if {[string match {[-<>]*} $ids]} {
243+
if {[string match {[-^<>]*} $ids]} {
244244
switch -- [string index $ids 0] {
245245
"-" {set listed 0}
246-
"<" {set listed 2}
247-
">" {set listed 3}
246+
"^" {set listed 2}
247+
"<" {set listed 3}
248+
">" {set listed 4}
248249
}
249250
set ids [string range $ids 1 end]
250251
}
@@ -3631,23 +3632,23 @@ proc drawcmittext {id row col} {
36313632
global linehtag linentag linedtag selectedline
36323633
global canvxmax boldrows boldnamerows fgcolor nullid nullid2
36333634

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
36353636
set listed [lindex $commitlisted $row]
36363637
if {$id eq $nullid} {
36373638
set ofill red
36383639
} elseif {$id eq $nullid2} {
36393640
set ofill green
36403641
} else {
3641-
set ofill [expr {$listed != 0? "blue": "white"}]
3642+
set ofill [expr {$listed != 0 ? $listed == 2 ? "gray" : "blue" : "white"}]
36423643
}
36433644
set x [xc $row $col]
36443645
set y [yc $row]
36453646
set orad [expr {$linespc / 3}]
3646-
if {$listed <= 1} {
3647+
if {$listed <= 2} {
36473648
set t [$canv create oval [expr {$x - $orad}] [expr {$y - $orad}] \
36483649
[expr {$x + $orad - 1}] [expr {$y + $orad - 1}] \
36493650
-fill $ofill -outline $fgcolor -width 1 -tags circle]
3650-
} elseif {$listed == 2} {
3651+
} elseif {$listed == 3} {
36513652
# triangle pointing left for left-side commits
36523653
set t [$canv create polygon \
36533654
[expr {$x - $orad}] $y \

0 commit comments

Comments
 (0)