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

[PATCH] gitk: Rename 'tagcontents' to 'cached_tagcontent'

From
David Aguilar <davvid@gmail.com>
Date
Sep 8, 2012, 19:53 UTC
Message-ID
<1347133996-70908-1-git-send-email-davvid@gmail.com>
In-Reply-To
<1347130993-69863-1-git-send-email-davvid@gmail.com>

Name the 'tagcontents' variable similarly to the rest of the variables cleared in the changedrefs() function.

This makes the naming consistent and provides a hint that it should be cleared when reloading gitk's cache.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
---
Follow-up to 'gitk: Teach "Reread references" to reload tags'
 gitk |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gitk b/gitk
index a124822..6f24f53 100755
--- a/gitk
+++ b/gitk
@@ -10599,7 +10599,7 @@ proc movedhead {hid head} {
 }
 
 proc changedrefs {} {
-    global cached_dheads cached_dtags cached_atags tagcontents
+    global cached_dheads cached_dtags cached_atags cached_tagcontent
     global arctags archeads arcnos arcout idheads idtags
 
     foreach id [concat [array names idheads] [array names idtags]] {
@@ -10611,7 +10611,7 @@ proc changedrefs {} {
 	    }
 	}
     }
-    catch {unset tagcontents}
+    catch {unset cached_tagcontent}
     catch {unset cached_dtags}
     catch {unset cached_atags}
     catch {unset cached_dheads}
@@ -10664,7 +10664,7 @@ proc listrefs {id} {
 }
 
 proc showtag {tag isnew} {
-    global ctext tagcontents tagids linknum tagobjid
+    global ctext cached_tagcontent tagids linknum tagobjid
 
     if {$isnew} {
 	addtohistory [list showtag $tag 0] savectextpos
@@ -10673,13 +10673,13 @@ proc showtag {tag isnew} {
     clear_ctext
     settabs 0
     set linknum 0
-    if {![info exists tagcontents($tag)]} {
+    if {![info exists cached_tagcontent($tag)]} {
 	catch {
-           set tagcontents($tag) [exec git cat-file tag $tag]
+           set cached_tagcontent($tag) [exec git cat-file tag $tag]
 	}
     }
-    if {[info exists tagcontents($tag)]} {
-	set text $tagcontents($tag)
+    if {[info exists cached_tagcontent($tag)]} {
+	set text $cached_tagcontent($tag)
     } else {
 	set text "[mc "Tag"]: $tag\n[mc "Id"]:  $tagids($tag)"
     }
-- 
1.7.7.2.448.gee6df
Previous: David AguilarNext: Junio C Hamano
Message 5 of 8 in “gitk does not reload tag messages”
  1. Tim McCormackSep 6, 2012
  2. David AguilarSep 7, 2012
  3. Junio C HamanoSep 7, 2012
  4. gitk: Teach "Reread references" to reload tagsDavid Aguilar, Sep 8, 2012
  5. gitk: Rename 'tagcontents' to 'cached_tagcontent'David Aguilar, Sep 8, 2012
  6. Junio C HamanoSep 9, 2012
  7. Junio C HamanoSep 12, 2012
  8. Paul MackerrasSep 12, 2012

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.