List for cgit developers and users
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: "François Kooman" <fkooman@tuxed.net>
Cc: cgit@lists.zx2c4.com
Subject: Re: renamed default branch, no "Idle" value on index at all
Date: Fri, 21 Aug 2020 17:01:20 +0100	[thread overview]
Message-ID: <20200821160120.GB11891@john.keeping.me.uk> (raw)
In-Reply-To: <943afd96-17df-df04-d143-0a2ef934cccc@tuxed.net>

On Thu, Aug 20, 2020 at 01:07:49PM +0200, François Kooman wrote:
> I switched the default branch from master to main in some of my 
> repositories. However, it seems cgit does not consider this when 
> determining "Idle" on the index page. It shows nothing in the column "Idle".
> 
> The FAQ [1] has an entry about this, but I am not seeing what the FAQ 
> describes...I modified the HEAD file in the repository on the server:
> 
> # git symbolic-ref HEAD refs/heads/main
> 
> Everything seems to work fine, cgit takes "main" as the default branch. 
> It seems cgit is hard coded to only look at "master" to determine idle 
> on the index?

It looks like the "guess default branch" logic isn't considered for the
index page.

If you set "repo.defbranch" in cgitrc (or via git config in the
repositories) then you can manually specify the default branch and that
will work everywhere.

Alternatively you can use a hook to update an agefile and that will be
read instead of the default branch.  This also allows setting the last
modified time to be the newest across a collection of branches.

I had a quick look at guessing the default branch (from HEAD) for the
repolist, but that's not simple because it requires initialising Git in
each repository (see cgit.c::guess_defbranch() which is used for repo
pages).


John

  reply	other threads:[~2020-08-21 16:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 11:07 François Kooman
2020-08-21 16:01 ` John Keeping [this message]
2020-08-21 16:25   ` François Kooman

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=20200821160120.GB11891@john.keeping.me.uk \
    --to=john@keeping.me.uk \
    --cc=cgit@lists.zx2c4.com \
    --cc=fkooman@tuxed.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).