Re: [PATCH] gitweb: ref markers link to named shortlogs
From: Giuseppe Bilotta <hidden>
Date: 2016-06-15 22:45:12
It is a good idea, but not so good solution.
Ok, let's see if I can find a better way to do it 8-)
quoted
--- a/gitweb/gitweb.css +++ b/gitweb/gitweb.cssquoted
+span.refs span a { + text-decoration: none; + color: inherit; +}Possible improvement: We would probably want to make this link discoverable, by adding underline on :hover, like for other "hidden links" in gitweb (for example in commitdiff view).
Can do that.
quoted
my ($type, $name) = qw(); + my $git_type = git_get_type($ref); # e.g. tags/v2.6.11 or heads/next if ($ref =~ m!^(.*?)s?/(.*)$!) { $type = $1;git_get_type calls 'git cat-file -t', so for each ref shown you make *additional call* to git command (additional fork). Not good, especially that you can get information if a ref is a tag (indirect reference) or not one can get from within git_get_references; which in turn uses "git show-refs --dereference" and used to use either "git peek-remote ." or ".git/info/refs" file. If there is <name>^{}, then <name> is indirect reference: is a tag. As we display ref markers only for log-like views, marker can be tag or can be "lightweight reference" and be only a commit (in theory we could show ref markers also for tree and blob items, but it is not important now).
By looking at git_get_reference() what I see is basically the use of the same field as $type in format_ref_marker(). I can probably use that, although it means that any future extensions to ref marker display will need to hack the routine too. (This would mean that the patch would be more similar to my original patch http://marc.info/?l=git&m=121769155017642&w=2 ). If this is not what you're suggesting, then I'm afraid I don't fully grasp your idea. -- Giuseppe "Oblomov" Bilotta