Code

gitk: Make "git describe" output clickable, too
[git.git] / gitk
diff --git a/gitk b/gitk
index 52bb0e9d35f74cec7b45956aaf59532c0cad7019..fc54f431f18a4ab72bb03a351ea79998629bb100 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -6734,7 +6734,7 @@ proc appendwithlinks {text tags} {
 
     set start [$ctext index "end - 1c"]
     $ctext insert end $text $tags
-    set links [regexp -indices -all -inline {\m[0-9a-f]{6,40}\M} $text]
+    set links [regexp -indices -all -inline {(?:\m|-g)[0-9a-f]{6,40}\M} $text]
     foreach l $links {
        set s [lindex $l 0]
        set e [lindex $l 1]
@@ -6750,6 +6750,10 @@ proc appendwithlinks {text tags} {
 proc setlink {id lk} {
     global curview ctext pendinglinks
 
+    if {[string range $id 0 1] eq "-g"} {
+      set id [string range $id 2 end]
+    }
+
     set known 0
     if {[string length $id] < 40} {
        set matches [longid $id]