Skip to content

Commit

Permalink
[PATCH] gitk: allow goto heads
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Rothwell authored and Paul Mackerras committed Apr 4, 2006
1 parent 79b2c75 commit e100712
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -2847,13 +2847,15 @@ proc sha1change {n1 n2 op} {
}

proc gotocommit {} {
global sha1string currentid commitrow tagids
global sha1string currentid commitrow tagids headids
global displayorder numcommits

if {$sha1string == {}
|| ([info exists currentid] && $sha1string == $currentid)} return
if {[info exists tagids($sha1string)]} {
set id $tagids($sha1string)
} elseif {[info exists headids($sha1string)]} {
set id $headids($sha1string)
} else {
set id [string tolower $sha1string]
if {[regexp {^[0-9a-f]{4,39}$} $id]} {
Expand All @@ -2879,7 +2881,7 @@ proc gotocommit {} {
if {[regexp {^[0-9a-fA-F]{4,}$} $sha1string]} {
set type "SHA1 id"
} else {
set type "Tag"
set type "Tag/Head"
}
error_popup "$type $sha1string is not known"
}
Expand Down Expand Up @@ -3370,7 +3372,6 @@ proc listrefs {id} {

proc rereadrefs {} {
global idtags idheads idotherrefs
global tagids headids otherrefids

set refids [concat [array names idtags] \
[array names idheads] [array names idotherrefs]]
Expand Down

0 comments on commit e100712

Please sign in to comment.