From a135f214e371311f13807da637d492fd9642a2e3 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sat, 7 Apr 2012 03:29:38 +0300 Subject: gitk: Avoid Meta1-F5 Meta1-F5 is commonly mapped by window managers and what not. Use Shift-F5 instead. Signed-off-by: Felipe Contreras Signed-off-by: Paul Mackerras --- gitk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitk b/gitk index 22270ce46..9bba9aa8d 100755 --- a/gitk +++ b/gitk @@ -2038,7 +2038,7 @@ proc makewindow {} { set file { mc "File" cascade { {mc "Update" command updatecommits -accelerator F5} - {mc "Reload" command reloadcommits -accelerator Meta1-F5} + {mc "Reload" command reloadcommits -accelerator Shift-F5} {mc "Reread references" command rereadrefs} {mc "List references" command showrefs -accelerator F2} {xx "" separator} @@ -2495,7 +2495,7 @@ proc makewindow {} { bindkey ? {dofind -1 1} bindkey f nextfile bind . updatecommits - bind . <$M1B-F5> reloadcommits + bind . reloadcommits bind . showrefs bind . {newview 0} catch { bind . {newview 0} } -- cgit v1.2.1 From 9b5bdf5913f850d1fc72c4219f794e2de549957f Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sat, 8 Sep 2012 12:03:13 -0700 Subject: gitk: Teach "Reread references" to reload tags Tag contents, once read, are forever cached in memory. This makes gitk unable to notice when tag contents change. Allow users to cause a reload of the tag contents by using the "File->Reread references" action. Reported-by: Tim McCormack Suggested-by: Junio C Hamano Signed-off-by: David Aguilar Signed-off-by: Junio C Hamano --- gitk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitk b/gitk index 9bba9aa8d..a12482262 100755 --- a/gitk +++ b/gitk @@ -10599,7 +10599,7 @@ proc movedhead {hid head} { } proc changedrefs {} { - global cached_dheads cached_dtags cached_atags + global cached_dheads cached_dtags cached_atags tagcontents global arctags archeads arcnos arcout idheads idtags foreach id [concat [array names idheads] [array names idtags]] { @@ -10611,6 +10611,7 @@ proc changedrefs {} { } } } + catch {unset tagcontents} catch {unset cached_dtags} catch {unset cached_atags} catch {unset cached_dheads} -- cgit v1.2.1 From 587277fea3bf3bfc4302480178bd88a277a69f05 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sat, 8 Sep 2012 12:53:16 -0700 Subject: gitk: Rename 'tagcontents' to 'cached_tagcontent' 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 Signed-off-by: David Aguilar Signed-off-by: Junio C Hamano --- gitk | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gitk b/gitk index a12482262..6f24f53d2 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)" } -- cgit v1.2.1