List for cgit developers and users
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: equa <equaa@protonmail.com>
Cc: "cgit@lists.zx2c4.com" <cgit@lists.zx2c4.com>
Subject: Re: [PATCH] Add "default-tab" and "root-default-tab" configuration options
Date: Sun, 13 Feb 2022 15:20:41 +0000	[thread overview]
Message-ID: <YgkhyU7s7yRDx7uu@keeping.me.uk> (raw)
In-Reply-To: <za0y1QaWB3dEbfM4JzSkr3RvHv8tr7lStOoAFlokRkGI7AHpwWEVsyOQxzrg6eINpcKaSCcgqK-4w3bIhb9ty2piIqpEysqEtJg-jKvtQks=@protonmail.com>

On Sun, Jan 30, 2022 at 06:04:10PM +0000, equa wrote:
> These options allow the user to specify a page to display at the root
> repository/index location instead of the default summary or repository list.
> 
> Signed-off-by: equa <equaa@protonmail.com>

We need a real name for the author and sign-off here.

> diff --git a/ui-shared.c b/ui-shared.c
> index acd8ab5..17b1e49 100644
> --- a/ui-shared.c
> +++ b/ui-shared.c
> @@ -203,6 +203,9 @@ static void site_url(const char *page, const char *search, const char *sort, int
>  {
>  	char *delim = "?";
> 
> +	if (!strcmp(page ? page : "", ctx.cfg.root_default_tab))
> +		page = NULL;
> +

Why is this necessary?  Is there any requirement to shorten the URL here
or does it just make it shorter?

>  	if (always_root || page)
>  		html_attr(cgit_rooturl());
>  	else {
> @@ -317,6 +320,12 @@ static void reporevlink(const char *page, const char *name, const char *title,
>  {
>  	char *delim;
> 
> +	if (page
> +	    && !rev
> +	    && !path
> +	    && !strcmp(page, ctx.repo->default_tab))
> +		page = NULL;
> +

Same as above, I don't see what advantage this gives.

  reply	other threads:[~2022-02-13 15:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-30 18:04 equa
2022-02-13 15:20 ` John Keeping [this message]
2022-02-13 16:05   ` june

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=YgkhyU7s7yRDx7uu@keeping.me.uk \
    --to=john@keeping.me.uk \
    --cc=cgit@lists.zx2c4.com \
    --cc=equaa@protonmail.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).