summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2011-12-10 15:08:57 (GMT)
committerPaul Mackerras <paulus@samba.org>2012-03-18 23:16:53 (GMT)
commit6c9e2d1842c8ab6e283df8633b42254fc1e2fcc6 (patch)
treef45748d33d4db762d7a086a9cb8468e4f8aeab65
parent65bb0bda75f4070a609d266d7231b4ec53d56972 (diff)
downloadgit-6c9e2d1842c8ab6e283df8633b42254fc1e2fcc6.zip
git-6c9e2d1842c8ab6e283df8633b42254fc1e2fcc6.tar.gz
git-6c9e2d1842c8ab6e283df8633b42254fc1e2fcc6.tar.bz2
gitk: Make "git describe" output clickable, too
Automake's contribution guidelines suggest using "git describe" output in commit logs to reference previous commits. By contrast, in coreutils, I had acquired the habit of using a bare SHA1 prefix (8 hex digits), since gitk creates clickable links for that, and not for "git describe" output. I prefer the readability of the full "git describe" output, yet want to retain the gitk links, so this renders as clickable not just SHA1-like strings, but also an SHA1-like string that is prefixed by "-g". Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rwxr-xr-xgitk6
1 files changed, 5 insertions, 1 deletions
diff --git a/gitk b/gitk
index 52bb0e9..fc54f43 100755
--- 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]