Re: [PATCH] gitweb: ref markers link to named shortlogs
- From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
- Date
- Aug 22, 2008, 07:21 UTC
- Message-ID
- <cb7bb73a0808220021w5d30d3c8i88ad85611035d2c5@mail.gmail.com>
- In-Reply-To
- <200808212332.07095.jnareb@gmail.com>
> 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-)
Show 13 quoted lines
>> --- a/gitweb/gitweb.css
>> +++ b/gitweb/gitweb.css
>
>> +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.
Show 18 quoted lines
>> 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