Re: [PATCH] gitweb: ref markers link to named shortlogs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Lea Wiemann wrote:
> Giuseppe Bilotta wrote:
> > +			my $git_type = git_get_type($ref);
> > [...]
> > +				$cgi->a({-href => href(action=>$view{$git_type} || $git_type, hash=>$name)}, $name) .
> 
> Since some of this thread seems to be about performance, you might just
> make this a link to action => 'object' (and save the git_get_type call)
> and let gitweb Do The Right Thing when the link is followed.
> 
> [Disclaimer: Haven't read the whole thread, and haven't checked if
> action=object is actually doing the right thing here.]

First, only the first patch (and perhaps second) called git_get_type;
v4 and v5 do not.  Second, link to 'object' action would not do the
right thing; we want either 'shortlog' or 'tag' view, not 'commit'
or 'tag' view.

What this patch does is making ref markers in the log-like views, and
in the commit subject line headers in other view be "hidden links" to
either 'shortlog' (in the case of ref being head/branch, or lightweight
tag), or to 'tag' view in the case of annotated tag.  We rely on the
fact that we know what type of object refs points to (currently it is
only 'commit', which might change, but the fact that we know type of
object for which we show marker would not change), and the fact that
tags point to given object only indirectly, and only tags can point
indirectly (^{} suffix in "git show-ref --dereference", and
"git ls-remote .", and $GIT_DIR/info/refs).


So you could have spared yourself this comment if you have read commit
and the rest of thread more carefully...
-- 
Jakub Narebski
Poland
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux