{"thread":{"id":"27139","subject":"[PATCH] gitk: When a commit contains a note, mark it with a yellow box.","startedAt":"2011-04-19T20:37:09Z","lastAt":"2011-04-19T20:37:09Z","messageCount":1,"participants":["Raphael Zimmerer"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"166103","messageId":"20110419203709.GA17397@rdrz.de","threadId":"27139","inReplyTo":null,"subject":"[PATCH] gitk: When a commit contains a note, mark it with a yellow box.","fromName":"Raphael Zimmerer","fromEmail":"killekulla@rdrz.de","sentAt":"2011-04-19T20:37:09Z","receivedAt":"2011-04-19T20:37:09Z","isPatch":true,"sender":{"key":"killekulla@rdrz.de","avatar":"https://avatars.githubusercontent.com/u/35472983?v=4"},"body":"It is desirable to see at a glance which commits do contain notes.\nTherefore mark them with a yellow rectangle.\n\nThat can be suppressed with `gitk --no-notes`.\n\nSigned-off-by: Raphael Zimmerer <killekulla@rdrz.de>\n---\n\nMaybe this patch is helpful. Sorry for any tcl/tk nonsense, it's not\nmy first language...\n\n gitk |   17 ++++++++++++++++-\n 1 files changed, 16 insertions(+), 1 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 4cde0c4..b182c75 100755\n--- a/gitk\n+++ b/gitk\n@@ -1674,8 +1674,9 @@ proc parsecommit {id contents listed} {\n     if {$comdate != {}} {\n \tset cdate($id) $comdate\n     }\n+    set hasnote [string first \"\\nNotes:\\n\" $contents]\n     set commitinfo($id) [list $headline $auname $audate \\\n-\t\t\t     $comname $comdate $comment]\n+\t\t\t     $comname $comdate $comment $hasnote]\n }\n \n proc getcommit {id} {\n@@ -5899,6 +5900,9 @@ proc drawcmittext {id row col} {\n \t|| [info exists idotherrefs($id)]} {\n \tset xt [drawtags $id $x $xt $y]\n     }\n+    if {[lindex $commitinfo($id) 6] > 0} {\n+\tset xt [drawnotesign $xt $y]\n+    }\n     set headline [lindex $commitinfo($id) 0]\n     set name [lindex $commitinfo($id) 1]\n     set date [lindex $commitinfo($id) 2]\n@@ -6345,6 +6349,17 @@ proc drawtags {id x xt y1} {\n     return $xt\n }\n \n+proc drawnotesign {xt y} {\n+    global linespc canv fgcolor\n+\n+    set orad [expr {$linespc / 3}]\n+    set t [$canv create rectangle [expr {$xt - $orad}] [expr {$y - $orad}] \\\n+\t       [expr {$xt + $orad - 1}] [expr {$y + $orad - 1}] \\\n+\t       -fill yellow -outline $fgcolor -width 1 -tags circle]\n+    set xt [expr {$xt + $orad * 3}]\n+    return $xt\n+}\n+\n proc xcoord {i level ln} {\n     global canvx0 xspc1 xspc2\n \n-- \n1.7.5.rc1.12.gff46a\n"}]}