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

Re: [PATCH] gitk: add Update menu item.

From
SVSven Verdoolaege <skimo@kotnet.org>
Date
Sep 20, 2005, 14:56 UTC
Message-ID
<20050920145658.GA13292MdfPADPa@greensroom.kotnet.org>
In-Reply-To
<20050920122423.GA4228MdfPADPa@greensroom.kotnet.org>
On Tue, Sep 20, 2005 at 02:24:23PM +0200, Sven Verdoolaege wrote:
> Update will redraw the commits if any commits have been added to any
> of the selected heads.  The new commits appear on the top.
> 

It appears I sent this patch to soon. With the additional patch below, it seems to work, that is, it survives a rebase.

I can send a replacement patch combining the two patches if anyone is interested.

skimo
diff --git a/gitk b/gitk
--- a/gitk
+++ b/gitk
@@ -68,6 +68,7 @@ proc getcommitlines {commfd}  {
     global oldcommits commits parents cdate children
     global commitlisted phase commitinfo nextupdate
     global stopped redisplaying leftover
+    global canv
 
     set stuff [read $commfd]
     if {$stuff == {}} {
@@ -126,6 +127,7 @@ to allow selection of commits to be disp
 	set olds [lrange $ids 1 end]
 	set cmit [string range $cmit [expr {$j + 1}] end]
 	if {$phase == "updatecommits"} {
+	    $canv delete all
 	    set oldcommits $commits
 	    set commits {}
 	    set phase getcommits
@@ -133,7 +135,7 @@ to allow selection of commits to be disp
 	lappend commits $id
 	set commitlisted($id) 1
 	parsecommit $id $cmit 1 [lrange $ids 1 end]
-	drawcommit $id
+	drawcommit $id 1
 	if {[clock clicks -milliseconds] >= $nextupdate} {
 	    doupdate 1
 	}
@@ -143,7 +145,7 @@ to allow selection of commits to be disp
 		set stopped 0
 		set phase "getcommits"
 		foreach id $commits {
-		    drawcommit $id
+		    drawcommit $id 1
 		    if {$stopped} break
 		    if {[clock clicks -milliseconds] >= $nextupdate} {
 			doupdate 1
@@ -1449,7 +1451,7 @@ proc decidenext {{noread 0}} {
     return $level
 }
 
-proc drawcommit {id} {
+proc drawcommit {id reading} {
     global phase todo nchildren datemode nextupdate
     global numcommits ncmupdate displayorder todo onscreen
 
@@ -1478,7 +1480,7 @@ proc drawcommit {id} {
 	    break
 	}
     }
-    drawmore 1
+    drawmore $reading
 }
 
 proc finishcommits {} {
@@ -1487,7 +1489,7 @@ proc finishcommits {} {
 
     if {$phase == "incrdraw"} {
 	foreach id $oldcommits {
-	    drawcommit $id
+	    drawcommit $id 0
 	}
 	set oldcommits {}
 	drawrest
@@ -3636,7 +3638,7 @@ proc rereadrefs {} {
 }
 
 proc updatecommits {rargs} {
-    global phase
+    global commfd phase
     global startmsecs nextupdate ncmupdate
     global idtags idheads idotherrefs
     global leftover
Previous: Sven VerdoolaegeNext: Paul Mackerras
Message 2 of 4 in “gitk: add Update menu item.”
  1. gitk: add Update menu item.Sven Verdoolaege, Sep 20, 2005
  2. Sven VerdoolaegeSep 20, 2005
  3. Paul MackerrasSep 21, 2005
  4. Sven VerdoolaegeSep 22, 2005

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.