Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

gitk: make "git describe" output clickable, too #3

Open
wants to merge 1 commit into from

2 participants

@keszybz

Hi,
this is a patch floated on the git mailing list. Please consider adding it to your pool
of gitk patches.

@meyering meyering gitk: make "git describe" output clickable, too
I noticed that 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 wrote the following that 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>
14c5b68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 20, 2012
  1. @meyering @keszybz

    gitk: make "git describe" output clickable, too

    meyering authored keszybz committed
    I noticed that 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 wrote the following that 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>
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 gitk
View
6 gitk
@@ -6705,7 +6705,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]
@@ -6721,6 +6721,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]
Something went wrong with that request. Please try again.