git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitk: When a commit contains a note, mark it with a yellow box.

From
Raphael Zimmerer <killekulla@rdrz.de>
Date
Apr 19, 2011, 20:37 UTC
Message-ID
<20110419203709.GA17397@rdrz.de>

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>
---

Maybe this patch is helpful. Sorry for any tcl/tk nonsense, it's not my first language...

 gitk |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/gitk b/gitk
index 4cde0c4..b182c75 100755
--- a/gitk
+++ b/gitk
@@ -1674,8 +1674,9 @@ proc parsecommit {id contents listed} {
     if {$comdate != {}} {
 	set cdate($id) $comdate
     }
+    set hasnote [string first "\nNotes:\n" $contents]
     set commitinfo($id) [list $headline $auname $audate \
-			     $comname $comdate $comment]
+			     $comname $comdate $comment $hasnote]
 }
 
 proc getcommit {id} {
@@ -5899,6 +5900,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]
@@ -6345,6 +6349,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
 
-- 
1.7.5.rc1.12.gff46a
Message 1 of 1 in “gitk: When a commit contains a note, mark it with a yellow box.”
  1. gitk: When a commit contains a note, mark it with a yellow box.Raphael Zimmerer, Apr 19, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.