From: Jakub Narebski <jnareb@gmail.com>
To: "Giuseppe Bilotta" <giuseppe.bilotta@gmail.com>
Cc: git@vger.kernel.org, "Petr Baudis" <pasky@ucw.cz>
Subject: Re: [PATCH] gitweb: ref markers link to named shortlogs
Date: Fri, 22 Aug 2008 10:49:20 +0200 [thread overview]
Message-ID: <200808221049.21337.jnareb@gmail.com> (raw)
In-Reply-To: <cb7bb73a0808220021w5d30d3c8i88ad85611035d2c5@mail.gmail.com>
On Fri, 22 Aug 2008, Giuseppe Bilotta wrote:
>>> --- 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.
Additional idea: it would be nice to know if clicking on ref marker
would lead us to 'shortlog' view, or to 'tag' view; so perhaps we should
distinguish somehow indirect refs, for example using bold font-weight.
>>> 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.
No, that is not what I was suggesting.
What format_ref_marker() uses is not exactly 'type' of reference, but
more 'kind of' reference. It is based on reference namespace, not
on type of object the reference is at (points to). So code based
on this info (like your v3 patch) would fail on lightweight tag, i.e.
if there is ref in 'refs/tags' namespace which points directly to commit,
and not to tag object.
But 'git show-ref --dereference' _has_ information about whether
given reference points directly or indirectly to given object
($refs->{$id}), but currently we neither save it, nor use it.
For example we can have:
781c1834f5419bdf81bb7f3750170ccd6b809174 refs/heads/maint
...
124c62e8781a8f03ee0256bee78f7b392e3920af refs/stash
...
89e6fcde639d65823e8113c307067441701ac74f refs/tags/Attic/gitweb/parse_rev_list
b69a41a384d19fe253b9f4f34c9019ad96ca571d refs/tags/Attic/gitweb/patchset_body
781c1834f5419bdf81bb7f3750170ccd6b809174 refs/tags/TEMP
...
07cca3b30ee2b5d060e44e5b18d7c22929c63d1a refs/tags/v1.5.6.5
781c1834f5419bdf81bb7f3750170ccd6b809174 refs/tags/v1.5.6.5^{}
Now in this example we have three refs pointing to commit object
781c1834: refs/heads/maint, refs/tags/TEMP and refs/tags/v1.5.6.5.
From those only refs/tags/v1.5.6.5 is (via) tag, even though TEMP
is in tags namespace. Currently git_get_references() strips '^{}'
indirect reference marker from the output (from refname), and doesn't
make use of it. One solution would be to not stip it in
git_get_references(), but leave it, and strip it and make use of
it (if ref ends with '^{}' it must be tag object) in format_ref_marker().
But that is just a proposal...
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2008-08-22 8:50 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-21 18:04 [PATCH] gitweb: ref markers link to named shortlogs Giuseppe Bilotta
2008-08-21 21:32 ` Jakub Narebski
2008-08-22 7:21 ` Giuseppe Bilotta
2008-08-22 8:49 ` Jakub Narebski [this message]
[not found] ` <cb7bb73a0808220231w37d2341eic56cabb595399f68@mail.gmail.com>
2008-08-22 10:56 ` Jakub Narebski
2008-08-22 12:34 ` Giuseppe Bilotta
2008-08-22 12:39 ` [PATCH v4] " Giuseppe Bilotta
2008-08-22 13:01 ` Jakub Narebski
2008-08-22 13:20 ` Giuseppe Bilotta
2008-08-22 13:42 ` Jakub Narebski
2008-08-22 14:03 ` Giuseppe Bilotta
2008-08-22 13:29 ` [PATCH v5] " Giuseppe Bilotta
2008-08-24 23:53 ` Jakub Narebski
2008-08-25 2:05 ` Miklos Vajna
2008-08-25 2:44 ` Jakub Narebski
2008-08-25 4:11 ` Junio C Hamano
2008-08-25 18:42 ` Jakub Narebski
2008-08-25 19:48 ` Junio C Hamano
2008-08-26 12:16 ` [PATCH v6] " Giuseppe Bilotta
2008-08-26 13:09 ` [PATCH v7] " Giuseppe Bilotta
2008-08-22 8:03 ` [PATCHv3] " Giuseppe Bilotta
2008-08-24 19:30 ` [PATCH] " Lea Wiemann
2008-08-24 19:41 ` Giuseppe Bilotta
2008-08-24 20:37 ` Jakub Narebski
2008-08-25 23:28 ` Giuseppe Bilotta
2008-08-26 8:15 ` Jakub Narebski
2008-08-26 10:58 ` Giuseppe Bilotta
2008-08-26 11:49 ` Jakub Narebski
2008-08-26 12:29 ` Giuseppe Bilotta
2008-08-27 18:36 ` Giuseppe Bilotta
2008-08-28 1:43 ` Lea Wiemann
2008-08-28 6:26 ` Giuseppe Bilotta
2008-08-28 6:48 ` Jakub Narebski
-- strict thread matches above, loose matches on Subject: below --
2008-08-02 15:39 Giuseppe Bilotta
2008-08-03 12:03 ` Petr Baudis
2008-08-03 13:14 ` Giuseppe Bilotta
2008-08-03 13:20 ` Petr Baudis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200808221049.21337.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=giuseppe.bilotta@gmail.com \
--cc=pasky@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).