List for cgit developers and users
 help / color / mirror / Atom feed
* renamed default branch, no "Idle" value on index at all
@ 2020-08-20 11:07 François Kooman
  2020-08-21 16:01 ` John Keeping
  0 siblings, 1 reply; 3+ messages in thread
From: François Kooman @ 2020-08-20 11:07 UTC (permalink / raw)
  To: cgit

Hi all,

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?

I'm running on Debian 10.

ii  cgit           1.2.1+git2.18.0-1 amd64        hyperfast web frontend 
for git repositories written in C
ii  git            1:2.20.1-2+deb10u3 amd64        fast, scalable, 
distributed revision control system

Cheers,
François

[1] https://git.zx2c4.com/cgit/about/faq

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: renamed default branch, no "Idle" value on index at all
  2020-08-20 11:07 renamed default branch, no "Idle" value on index at all François Kooman
@ 2020-08-21 16:01 ` John Keeping
  2020-08-21 16:25   ` François Kooman
  0 siblings, 1 reply; 3+ messages in thread
From: John Keeping @ 2020-08-21 16:01 UTC (permalink / raw)
  To: François Kooman; +Cc: cgit

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: renamed default branch, no "Idle" value on index at all
  2020-08-21 16:01 ` John Keeping
@ 2020-08-21 16:25   ` François Kooman
  0 siblings, 0 replies; 3+ messages in thread
From: François Kooman @ 2020-08-21 16:25 UTC (permalink / raw)
  To: John Keeping; +Cc: cgit

On 8/21/20 6:01 PM, John Keeping wrote:
> It looks like the "guess default branch" logic isn't considered for the
> index page.

Ah I see!

> 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 did that now as it actually nice to base the age on all branches and 
not just on the default.

> 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).

Seems there is not an quick easy fix to make that work, in any case the 
hook is better!

Thanks!

Regards,
François

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-21 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20 11:07 renamed default branch, no "Idle" value on index at all François Kooman
2020-08-21 16:01 ` John Keeping
2020-08-21 16:25   ` François Kooman

List for cgit developers and users

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/cgit

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 cgit cgit/ http://inbox.vuxu.org/cgit \
		cgit@lists.zx2c4.com
	public-inbox-index cgit

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.cgit


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git