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

[PATCH/RFC 2/2] Remove $tagobjid from tagcontents population

From
Dave Dulson <dave@dulson.com>
Date
Jan 10, 2010, 22:45 UTC
Message-ID
<2ee0b0aa1001101445u5962ec25y6fe612a70d283c92@mail.gmail.com>

When the showtag proc is called directly after the tag has been created rereadrefs hasn't been called, meaning the tag doesn't exist in $tagobjid. This causes the cat-file to fail. Instead of using $tagobjid, pass the $tag directly, ensuring the tag contents are populated correctly.

Signed-off-by: David Dulson <dave@dulson.com>
---
 gitk |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gitk b/gitk
index b34b481..65721e3 100755
--- a/gitk
+++ b/gitk
@@ -10482,7 +10482,7 @@ proc listrefs {id} {
 }

 proc showtag {tag isnew} {
-    global ctext tagcontents tagids linknum tagobjid
+    global ctext tagcontents tagids linknum

     if {$isnew} {
 	addtohistory [list showtag $tag 0] savectextpos
@@ -10493,7 +10493,7 @@ proc showtag {tag isnew} {
     set linknum 0
     if {![info exists tagcontents($tag)]} {
 	catch {
-	    set tagcontents($tag) [exec git cat-file tag $tagobjid($tag)]
+           set tagcontents($tag) [exec git cat-file tag $tag]
 	}
     }
     if {[info exists tagcontents($tag)]} {
-- 
1.6.6.75.g37bae.dirty
Message 1 of 1 in “Remove $tagobjid from tagcontents population”
  1. 2/2 Remove $tagobjid from tagcontents populationDave Dulson, Jan 10, 2010

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.