Skip to content

Commit

Permalink
gitk: When a commit contains a note, mark it with a yellow box
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Raphael Zimmerer authored and Paul Mackerras committed May 29, 2011
1 parent f5974d9 commit 3624249
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion gitk
Original file line number Diff line number Diff line change
Expand Up @@ -1671,8 +1671,9 @@ proc parsecommit {id contents listed} {
}
set comment $newcomment
}
set hasnote [string first "\nNotes:\n" $contents]
set commitinfo($id) [list $headline $auname $audate \
$comname $comdate $comment]
$comname $comdate $comment $hasnote]
}

proc getcommit {id} {
Expand Down Expand Up @@ -5896,6 +5897,9 @@ proc drawcmittext {id row col} {
|| [info exists idotherrefs($id)]} {
set xt [drawtags $id $x $xt $y]
}
if {[lindex $commitinfo($id) 6] > 0} {
set xt [drawnotesign $xt $y]
}
set headline [lindex $commitinfo($id) 0]
set name [lindex $commitinfo($id) 1]
set date [lindex $commitinfo($id) 2]
Expand Down Expand Up @@ -6342,6 +6346,17 @@ proc drawtags {id x xt y1} {
return $xt
}

proc drawnotesign {xt y} {
global linespc canv fgcolor

set orad [expr {$linespc / 3}]
set t [$canv create rectangle [expr {$xt - $orad}] [expr {$y - $orad}] \
[expr {$xt + $orad - 1}] [expr {$y + $orad - 1}] \
-fill yellow -outline $fgcolor -width 1 -tags circle]
set xt [expr {$xt + $orad * 3}]
return $xt
}

proc xcoord {i level ln} {
global canvx0 xspc1 xspc2

Expand Down

0 comments on commit 3624249

Please sign in to comment.