gitk: When a commit contains a note, mark it with a yellow box
It is desirable to see at a glance which commits do contain notes. Therefore mark them with a yellow rectangle. That can be suppressed with `gitk --no-notes`. Signed-off-by: Raphael Zimmerer <killekulla@rdrz.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
Raphael Zimmerer committed
Apr 19, 2011 at 22:37 UTC
36242490cd012bcf5148475aaa1a5abb76e4ef66
1 file changed
+16
-1
gitk
+16
-1
@@ -1671,8 +1671,9 @@ proc parsecommit {id contents listed} {
1671
}
1672
set comment $newcomment
1673
}
1674
+ set hasnote [string first "\nNotes:\n" $contents]
1675
set commitinfo($id) [list $headline $auname $audate \
1675
- $comname $comdate $comment]
1676
+ $comname $comdate $comment $hasnote]
1677
}
1678
1679
proc getcommit {id} {
@@ -5896,6 +5897,9 @@ proc drawcmittext {id row col} {
5897
|| [info exists idotherrefs($id)]} {
5898
set xt [drawtags $id $x $xt $y]
5899
}
5900
+ if {[lindex $commitinfo($id) 6] > 0} {
5901
+ set xt [drawnotesign $xt $y]
5902
+ }
5903
set headline [lindex $commitinfo($id) 0]
5904
set name [lindex $commitinfo($id) 1]
5905
set date [lindex $commitinfo($id) 2]
@@ -6342,6 +6346,17 @@ proc drawtags {id x xt y1} {
6346
return $xt
6347
}
6348
6349
+proc drawnotesign {xt y} {
6350
+ global linespc canv fgcolor
6351
+
6352
+ set orad [expr {$linespc / 3}]
6353
+ set t [$canv create rectangle [expr {$xt - $orad}] [expr {$y - $orad}] \
6354
+ [expr {$xt + $orad - 1}] [expr {$y + $orad - 1}] \
6355
+ -fill yellow -outline $fgcolor -width 1 -tags circle]
6356
+ set xt [expr {$xt + $orad * 3}]
6357
+ return $xt
6358
+}
6359
+
6360
proc xcoord {i level ln} {
6361
global canvx0 xspc1 xspc2
6362