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

[PATCH] gitk: Fix for tree view ending in nested directories

From
Brian Downing <bdowning@lavos.net>
Date
Jul 4, 2007, 21:26 UTC
Message-ID
<20070704212643.GR4087@lavos.net>

Unroll the prefix stack when assigning treeheights when leaving proc treeview. Previously, when the ls-tree output ended in multiple nested directories (for instance in a repository with a single file "foo/bar/baz"), $treeheight("foo/bar/") was assigned twice, and $treeheight("foo/") was never assigned. This led to an error when expanding the "foo" directory in the gitk treeview.

Signed-off-by: Brian Downing <bdowning@lavos.net>
---
 gitk |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/gitk b/gitk
index 2d6a6ef..d94c512 100755
--- a/gitk
+++ b/gitk
@@ -1216,6 +1216,9 @@ proc treeview {w l openlevs} {
 	set treeheight($prefix) $ht
 	incr ht [lindex $htstack end]
 	set htstack [lreplace $htstack end end]
+	set prefixend [lindex $prefendstack end]
+	set prefendstack [lreplace $prefendstack end end]
+	set prefix [string range $prefix 0 $prefixend]
     }
     $w conf -state disabled
 }
-- 
1.5.2.GIT
Message 1 of 1 in “gitk: Fix for tree view ending in nested directories”
  1. gitk: Fix for tree view ending in nested directoriesBrian Downing, Jul 4, 2007

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.