From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCHv6 10/10] gitweb: group remote heads by remote
Date: Mon, 8 Nov 2010 09:28:45 +0100 [thread overview]
Message-ID: <AANLkTimxspcGLnv+F6uKAnFAhUO++iB10b5GxnLVg_v3@mail.gmail.com> (raw)
In-Reply-To: <201011041141.58334.jnareb@gmail.com>
On Thu, Nov 4, 2010 at 11:41 AM, Jakub Narebski <jnareb@gmail.com> wrote:
> On Wed, 3 Nov 2010, Giuseppe Bilotta wrote:
>>
>> I think that in most cases there won't be any need for limiting.
>> Public cases of lots of remotes with lots of branches are, I suspect,
>> rare.
>
> It's not about _public_ cases; I think that it is in very rare cases
> that public repository would want to display remotes and remote-tracking
> branches.
That's a good point.
> I think remote_heads feature is more important for _local_ use, for
> example browsing one own repository using git-instaweb. In such cases
> number of remotes and of remote-tracking branches might be large (I have
> 11 remotes, not all active, and 58 remote-tracking branches).
>
> BTW. would next version of this series include patch to git-instaweb
> enabling 'remote_heads' feature for it (gitweb_conf function)?
I will look into that.
>> with all the remotes/<remotename> pathspecs as a single array
>> argument. This _does_ mean that when the total number of remote heads
>> is greater than the limit some remotes will not display complete
>> information in summary view. The real issue here is, I think, that
>> there is no trivial way to tell which remotes have incomplete
>> information and which don't, meaning that in the subsequent
>> git_remote_block calls we'll have no way to provide visual feedback
>> (the ellipsis) when some heads are missing.
>
> Errr... shouldn't we leave limiting number of heads to fill_remote_heads,
> which can do limiting per remote (with each remote having up to $limit
> remote-tracking branches / remote heads), instead of having
> git_get_heads_list do it?
>
> Something like this:
>
> +sub fill_remote_heads {
> + my ($remotes, $limit) = @_;
> +
> + my @heads = map { "remotes/$_" } keys %$remotes;
> + my @remoteheads = git_get_heads_list(undef, @heads);
> + foreach my $remote (keys %$remotes) {
> + $remotes->{$remote}{'heads'} =
> + [ grep { $_->{'name'} =~ s!^$remote/!! } @remoteheads ];
> + $remotes->{$remote}{'heads'} =
> + [ @{$remotes->{$remote}{'heads'}}[0..$limit-1] ]
> + if (@{$remotes->{$remote}{'heads'}} > $limit);
> + }
> +}
>
> Though perhaps it will be more clear with if as statement, not as modifier:
>
> +sub fill_remote_heads {
> + my ($remotes, $limit) = @_;
> +
> + my @heads = map { "remotes/$_" } keys %$remotes;
> + my @remoteheads = git_get_heads_list(undef, @heads);
> + foreach my $remote (keys %$remotes) {
> + $remotes->{$remote}{'heads'} =
> + [ grep { $_->{'name'} =~ s!^$remote/!! } @remoteheads ];
> + if (@{$remotes->{$remote}{'heads'}} > $limit) {
> + $remotes->{$remote}{'heads'} =
> + [ @{$remotes->{$remote}{'heads'}}[0..$limit-1] ]
> + }
> + }
> +}
Either solution is fine, but it would require grabbing all the remote
heads. The real issue here is, I think understanding what is the
purpose of limiting in gitweb. Is it to reduce runtime? is it to
reduce clutter on the screen? In the first case, the limiting should
be done as early as possible (i.e. during the git call that retrieves
the data); in the latter case, is it _really_ needed at all?
--
Giuseppe "Oblomov" Bilotta
next prev parent reply other threads:[~2010-11-08 8:29 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-24 10:45 [PATCHv6 00/10] gitweb: remote_heads feature Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 01/10] gitweb: introduce " Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 02/10] gitweb: git_get_heads_list accepts an optional list of refs Giuseppe Bilotta
2010-10-25 21:56 ` Jakub Narebski
2010-10-26 16:30 ` Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 03/10] gitweb: separate heads and remotes lists Giuseppe Bilotta
2010-10-25 15:01 ` Jakub Narebski
2010-10-25 18:14 ` Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 04/10] gitweb: nagivation menu for tags, heads and remotes Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 05/10] gitweb: use fullname as hash_base in heads link Giuseppe Bilotta
2010-10-25 14:56 ` Jakub Narebski
2010-10-25 15:07 ` Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 06/10] gitweb: allow action specialization in page header Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 07/10] gitweb: remotes view for a single remote Giuseppe Bilotta
2010-10-25 15:12 ` Jakub Narebski
2010-10-25 18:18 ` Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 08/10] gitweb: refactor repository URL printing Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 09/10] gitweb: provide a routine to display (sub)sections Giuseppe Bilotta
2010-10-25 15:15 ` Jakub Narebski
2010-10-25 18:21 ` Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 10/10] gitweb: group remote heads by remote Giuseppe Bilotta
2010-10-27 0:32 ` Jakub Narebski
2010-10-27 8:07 ` Jakub Narebski
2010-11-02 10:49 ` Giuseppe Bilotta
2010-11-02 23:58 ` Jakub Narebski
2010-11-03 7:49 ` Giuseppe Bilotta
2010-11-04 10:41 ` Jakub Narebski
2010-11-08 8:28 ` Giuseppe Bilotta [this message]
2010-11-08 11:05 ` Jakub Narebski
2010-11-08 11:18 ` Giuseppe Bilotta
2010-11-08 13:41 ` Jakub Narebski
2010-10-27 12:38 ` Jakub Narebski
2010-10-25 18:38 ` [PATCHv6 00/10] gitweb: remote_heads feature Jakub Narebski
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=AANLkTimxspcGLnv+F6uKAnFAhUO++iB10b5GxnLVg_v3@mail.gmail.com \
--to=giuseppe.bilotta@gmail.com \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
/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).