summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4f2c264)
raw | patch | inline | side by side (parent: 4f2c264)
author | Paul Mackerras <paulus@dorrigo.(none)> | |
Mon, 18 Jul 2005 16:16:35 +0000 (12:16 -0400) | ||
committer | Paul Mackerras <paulus@dorrigo.(none)> | |
Mon, 18 Jul 2005 16:16:35 +0000 (12:16 -0400) |
gitk | patch | blob | history |
index d994eec9152ed9da822c21d48f9405f00609ff07..9e52a3579150637dbfeb36d79c392e4a8624532a 100755 (executable)
--- a/gitk
+++ b/gitk
proc gotocommit {} {
global sha1string currentid idline tagids
+ global lineid numcommits
+
if {$sha1string == {}
|| ([info exists currentid] && $sha1string == $currentid)} return
if {[info exists tagids($sha1string)]} {
set id $tagids($sha1string)
} else {
set id [string tolower $sha1string]
+ if {[regexp {^[0-9a-f]{4,39}$} $id]} {
+ set matches {}
+ for {set l 0} {$l < $numcommits} {incr l} {
+ if {[string match $id* $lineid($l)]} {
+ lappend matches $lineid($l)
+ }
+ }
+ if {$matches ne {}} {
+ if {[llength $matches] > 1} {
+ error_popup "Short SHA1 id $id is ambiguous"
+ return
+ }
+ set id [lindex $matches 0]
+ }
+ }
}
if {[info exists idline($id)]} {
selectline $idline($id)
return
}
- if {[regexp {^[0-9a-fA-F]{40}$} $sha1string]} {
+ if {[regexp {^[0-9a-fA-F]{4,}$} $sha1string]} {
set type "SHA1 id"
} else {
set type "Tag"