Skip to content

Commit 3624249

Browse files
killekullapaulusmack
authored andcommitted
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent f5974d9 commit 3624249

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

gitk

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1671,8 +1671,9 @@ proc parsecommit {id contents listed} {
16711671
}
16721672
set comment $newcomment
16731673
}
1674+
set hasnote [string first "\nNotes:\n" $contents]
16741675
set commitinfo($id) [list $headline $auname $audate \
1675-
$comname $comdate $comment]
1676+
$comname $comdate $comment $hasnote]
16761677
}
16771678

16781679
proc getcommit {id} {
@@ -5896,6 +5897,9 @@ proc drawcmittext {id row col} {
58965897
|| [info exists idotherrefs($id)]} {
58975898
set xt [drawtags $id $x $xt $y]
58985899
}
5900+
if {[lindex $commitinfo($id) 6] > 0} {
5901+
set xt [drawnotesign $xt $y]
5902+
}
58995903
set headline [lindex $commitinfo($id) 0]
59005904
set name [lindex $commitinfo($id) 1]
59015905
set date [lindex $commitinfo($id) 2]
@@ -6342,6 +6346,17 @@ proc drawtags {id x xt y1} {
63426346
return $xt
63436347
}
63446348

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+
63456360
proc xcoord {i level ln} {
63466361
global canvx0 xspc1 xspc2
63476362

0 commit comments

Comments
 (0)