From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23429 invoked from network); 13 Feb 2022 15:21:00 -0000 Received: from lists.zx2c4.com (165.227.139.114) by inbox.vuxu.org with ESMTPUTF8; 13 Feb 2022 15:21:00 -0000 Received: by lists.zx2c4.com (OpenSMTPD) with ESMTP id abb70a6f; Sun, 13 Feb 2022 15:20:52 +0000 (UTC) Return-Path: Received: from mta02.prd.rdg.aluminati.org (mta02.prd.rdg.aluminati.org [94.76.243.215]) by lists.zx2c4.com (OpenSMTPD) with ESMTPS id 53889272 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Sun, 13 Feb 2022 15:20:51 +0000 (UTC) Received: from mta02.prd.rdg.aluminati.org (localhost [127.0.0.1]) by mta.aluminati.local (Postfix) with ESMTP id E917A20145; Sun, 13 Feb 2022 15:20:50 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by mta02.prd.rdg.aluminati.org (Postfix) with ESMTP id D63FD64; Sun, 13 Feb 2022 15:20:50 +0000 (GMT) X-Quarantine-ID: X-Virus-Scanned: Debian amavisd-new at mta02.prd.rdg.aluminati.org Received: from mta.aluminati.local ([127.0.0.1]) by localhost (mta02.prd.rdg.aluminati.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qvSYK4CrU4k0; Sun, 13 Feb 2022 15:20:50 +0000 (GMT) Received: from keeping.me.uk (unknown [81.174.171.191]) by svc01-1.prd.rdg.aluminati.org (Postfix) with ESMTPSA id 396891C0002; Sun, 13 Feb 2022 15:20:47 +0000 (GMT) Date: Sun, 13 Feb 2022 15:20:41 +0000 From: John Keeping To: equa Cc: "cgit@lists.zx2c4.com" Subject: Re: [PATCH] Add "default-tab" and "root-default-tab" configuration options Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: cgit@lists.zx2c4.com X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: List for cgit developers and users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cgit-bounces@lists.zx2c4.com Sender: "CGit" 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 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.