From: Jakub Narebski <jnareb@gmail.com>
To: "Sébastien Cevey" <seb@cine7.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Petr Baudis <pasky@suse.cz>,
Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
Subject: Re: [PATCH v3 3/3] gitweb: Optional grouping of projects by category
Date: Fri, 5 Dec 2008 11:45:08 +0100 [thread overview]
Message-ID: <200812051145.09732.jnareb@gmail.com> (raw)
In-Reply-To: <87bpvr1hee.wl%seb@cine7.net>
On Fri, 5 Dec 2008 at 03:32, Sébastien Cevey wrote:
> At Fri, 5 Dec 2008 03:08:52 +0100, Jakub Narebski wrote:
>
> > Nice... but perhaps it would be better to simply pass $from / $to to
> > build_projlist_by_category function, and have in %categories only
> > projects which are shown...
>
> Ah you're right, we could do that, I hadn't thought of it. Sounds
> cleaner than the $from/$to dance I did in this patch.
Usually simpler is better. The more complicated code, the more chances
for bugs, and less maintability. I haven't even tried to follow
$from/$to updating logic, but noticed that we can simply pass $from
and $to to build_projlist_by_category(), and use loop $from..$to there.
> > well, unless filtered out in print_project_rows() by $show_ctags; so
> > I think that there is nonzero probability of empty (no project
> > shown) categories.
>
> Mh indeed, in fact this could happen any time we reach one of the
> 'next' statements in the loop in print_project_rows(), when performing
> search, tag filtering, etc...
>
> Actually, assuming the project list is split into page, this can also
> lead to empty pages (if no project on the page matches the filter).
> To avoid empty categories, it's a bit tricky since the header is
> printed before we determine whether there are matching projects..
>
> I need to read the code more carefully, but it seems that one solution
> would be to add a function that determines whether a project should be
> displayed or not (according to tags and search and forks); then we can
> map this function on the list of projects.
>
> I could do it if it sounds sane to you.
Nah, I think it would be best to postpone dealing with this issue, and
keep the code simple at the cost of possibly empty categories. It is
not as empty categories are an actual error...
I guess that correct way to deal with this would be to filter projects
earlier, before grouping by category, and not "at the last minute",
when displaying them. It might be even better solution wrt. dividing
projects list into pages. But that in my opinion is certainly matter
for a separate patch.
> > I'll try to examine the code in more detail later... currently I don't
> > know why but I can't git-am the second patch (this patch) correctly...
>
> This is the third patch, are you sure you applied 1 and 2 before?
Somehow I couldn't apply second patch in series:
$ git am -3 -u "[PATCH v3 2_3] gitweb: Split git_project_list_body in two functions.txt"
Applying: gitweb: Split git_project_list_body in two functions
error: patch failed: gitweb/gitweb.perl:3972
error: gitweb/gitweb.perl: patch does not apply
fatal: sha1 information is lacking or useless (gitweb/gitweb.perl).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001.
> Thanks for your careful and supportive comments!
You are welcome. Nice to have another gitweb developer :-)
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2008-12-05 10:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-02 15:04 [PATCH] gitweb: Optional grouping of projects by category Sebastien Cevey
2008-12-02 23:36 ` Jakub Narebski
2008-12-03 14:22 ` [PATCH v2] " Sébastien Cevey
2008-12-03 22:51 ` Junio C Hamano
2008-12-03 23:12 ` Jakub Narebski
2008-12-04 0:39 ` [PATCH v3 0/3] " Sébastien Cevey
2008-12-04 0:43 ` Junio C Hamano
2008-12-04 0:42 ` [PATCH v3 1/3] gitweb: Modularized git_get_project_description to be more generic Sébastien Cevey
2008-12-04 0:44 ` [PATCH v3 2/3] gitweb: Split git_project_list_body in two functions Sébastien Cevey
2008-12-04 0:46 ` [PATCH v3 3/3] gitweb: Optional grouping of projects by category Sébastien Cevey
2008-12-04 19:37 ` Junio C Hamano
2008-12-05 2:08 ` Jakub Narebski
2008-12-05 2:32 ` Sébastien Cevey
2008-12-05 10:45 ` Jakub Narebski [this message]
2008-12-11 23:34 ` Sébastien Cevey
2008-12-12 0:13 ` Jakub Narebski
2008-12-12 0:40 ` Sébastien Cevey
2008-12-12 2:03 ` Jakub Narebski
2008-12-12 3:10 ` Sébastien Cevey
2008-12-12 9:26 ` Jakub Narebski
2008-12-05 1:52 ` [PATCH v3 2/3] gitweb: Split git_project_list_body in two functions Jakub Narebski
2008-12-05 1:38 ` [PATCH v3 1/3] gitweb: Modularized git_get_project_description to be more generic Jakub Narebski
2008-12-03 14:29 ` [PATCH] gitweb: Optional grouping of projects by category Sébastien Cevey
2008-12-03 21:14 ` Junio C Hamano
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=200812051145.09732.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=barbieri@profusion.mobi \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pasky@suse.cz \
--cc=seb@cine7.net \
/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).