[PATCH] gitk: allow goto heads
This patch allows you to enter a head name in the SHA1 id: field. It also removes some unnecessary global declarations. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Stephen Rothwell committed
Mar 30, 2006 at 16:13 UTC
e100712968cb781183a549f164e34596d6e7fcb2
1 file changed
+4
-3
gitk
+4
-3
@@ -2847,13 +2847,15 @@ proc sha1change {n1 n2 op} {
2847
}
2848
2849
proc gotocommit {} {
2850
- global sha1string currentid commitrow tagids
2850
+ global sha1string currentid commitrow tagids headids
2851
global displayorder numcommits
2852
2853
if {$sha1string == {}
2854
|| ([info exists currentid] && $sha1string == $currentid)} return
2855
if {[info exists tagids($sha1string)]} {
2856
set id $tagids($sha1string)
2857
+ } elseif {[info exists headids($sha1string)]} {
2858
+ set id $headids($sha1string)
2859
} else {
2860
set id [string tolower $sha1string]
2861
if {[regexp {^[0-9a-f]{4,39}$} $id]} {
@@ -2879,7 +2881,7 @@ proc gotocommit {} {
2881
if {[regexp {^[0-9a-fA-F]{4,}$} $sha1string]} {
2882
set type "SHA1 id"
2883
} else {
2882
- set type "Tag"
2884
+ set type "Tag/Head"
2885
}
2886
error_popup "$type $sha1string is not known"
2887
}
@@ -3370,7 +3372,6 @@ proc listrefs {id} {
3372
3373
proc rereadrefs {} {
3374
global idtags idheads idotherrefs
3373
- global tagids headids otherrefids
3375
3376
set refids [concat [array names idtags] \
3377
[array names idheads] [array names idotherrefs]]