git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Jakub Narębski" <jnareb@gmail.com>
To: Tony Finch <dot@dotat.at>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: What's cooking in git.git (Jul 2015, #01; Wed, 1)
Date: Wed, 22 Jul 2015 21:32:48 +0200	[thread overview]
Message-ID: <55AFEFE0.9000606@gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.00.1507221351420.12758@hermes-1.csi.cam.ac.uk>

W dniu 2015-07-22 o 15:19, Tony Finch pisze:
> Jakub Narębski <jnareb@gmail.com> wrote:
>>
>> A question about implementation: why emptying $path_info in
>> evaluate_path_info()?
> 
> That was for consistency with other parts of the subroutine which (mostly)
> remove items from the global $path_info variable when they are added to
> %input_params. But since $path_info isn't used after it has been parsed, I
> suppose it is redundant.

If it is for consistency, better leave it in my opinion.

>>>> - I think that people would want to be able to configure how
>>>>   many levels of directory hierarchy gets turned into categories.
>>>>   Perhaps only top level should be turned into category? Deep
>>>>   hierarchies means deep categories (usually with very few
>>>>   repositories) with current implementation.
>>>
>>> Good question. I was assuming flat-ish directory hierarchies, but that's
>>> clearly not very true, e.g. https://git.kernel.org/cgit/
>>>
>>> I think it would be right to make this a %feature since categories already
>>> nearly fit the %feature per-project override style.
>>
>> On the other hand $projects_list_group_categories is a global gitweb
>> configuration variable, and $projects_list_directory_is_category was
>> patterned after it.
> 
> Yes... Which do you prefer? :-)

Hmmm... does it makes sense to have per-repository override?  If yes,
then we need to use %features. If not... I am not sure, %features is
newer than global (or rather package) variables for gitweb configuration,
which must be left for legacy config support (and few are needed before
%features are parsed).

>> A few thoughts about implementation:
> 
> Helpful, thanks!
> 
>> - can we turn category header into link even if the category didn't
>>   came from $projects_list_directory_is_category?
> 
> That would mean changing the project filter to match categories as well as
> paths. I don't know if this is the right thing to do; perhaps it is,
> because the current behaviour of my category headings is a bit surprising.
> 
> At the moment, clicking on the "git" category heading on the page linked
> below takes you to a page that does not list all the repos that were under
> the category heading on the main page.
> 
> https://git.csx.cam.ac.uk/x/ucs/

I thought gitweb had a way to list all projects belonging to given category,
but I see that it doesn't.  So you need to find out if 'category' came from
category or from pathname, to decide whether to link it using 'projects_list'
action and 'project_filter' parameter (or their PATH_INFO version), or not.

This can be done either by checking that category name is directory (though
we could have false positives here), or when adding categories denote where
it came from (e.g. with additional field).  I think the second is better,
if we are to hyperlink category-from-pathname headings.

There is interesting corner case: what if some projects use category, and
some have the same category from pathname?  Clicking on category if 
hyper-linked would show only a subset of projects inside category. (I think
this is the oddity you noticed.)

>> - even if $projects_list_directory_is_category is true, the category
>>   could came from 'category' file, or otherwise manually set category,
>>   though I wonder how we can easily detect this...
> 
> Yes - I use this to list my personal/experimental repos alongside
> the production repos.
> 
> I'm not sure why gitweb would need to detect this or what it would do in
> response. At the moment it "just works", apart from the oddity with
> categories vs project filters i described above.

What if there is synthetic category that has no representative in the
path hierarchy?  Then "project_filter" link would lead to strange empty
list of projects...

For example http://git.zx2c4.com/ (cgit) uses "Mirrors" category...

We could either abuse "project_filter" for categories, or add a new
query parameter "project_category" or "cat" in short. In either case
it would not have PATH_INFO URL unless category came from directory.

Food for thought
-- 
Jakub Narębski

  reply	other threads:[~2015-07-22 19:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01 22:37 What's cooking in git.git (Jul 2015, #01; Wed, 1) Junio C Hamano
2015-07-02  9:33 ` [PUB]What's " Matthieu Moy
2015-07-03 17:57   ` Junio C Hamano
2015-07-21 18:09 ` What's " Jakub Narębski
2015-07-22 10:05   ` Tony Finch
2015-07-22 11:16     ` Jakub Narębski
2015-07-22 13:19       ` Tony Finch
2015-07-22 19:32         ` Jakub Narębski [this message]
2015-07-22 21:14           ` Tony Finch

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55AFEFE0.9000606@gmail.com \
    --to=jnareb@gmail.com \
    --cc=dot@dotat.at \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).