Herr Bischoff


cgit: Missing Idle Column on Some Repositories

For some time now, several of my repositories on my cgit instance were missing updated entries in the “Idle” column. In fact, they were left completely empty.

Searching the cgit mailing list archives unearthed a thread from August 2020 discussing the behavior. Apparently cgit is hard-coded to only look at the “master” branch. I also found out about the repo.defbranch setting. The affected repositories do use different default branches.

Searching within man cgitrc yields:

repo.defbranch
    The name of the default branch for this repository. If no such
    branch exists in the repository, the first branch name (when
    sorted) is used as default instead. Default value: branch pointed
    to by HEAD, or "master" if there is no suitable HEAD.

It would be useful to have an option to set this globally. Alas, no such luck. Additionally, as I’m using a scan-path, I cannot set repo.defbranch in the main cgitrc file. However, further down, the same document specifies:

REPOSITORY-SPECIFIC CGITRC FILE
    When the option "scan-path" is used to auto-discover git repositories,
    cgit will try to parse the file "cgitrc" within any found repository.
    Such a repo-specific config file may contain any of the repo-specific
    options described above, except "repo.url" and "repo.path".
    Additionally, the "filter" options are only acknowledged in
    repo-specific config files when "enable-filter-overrides" is set to
    "1".

    Note: the "repo." prefix is dropped from the option names in
    repo-specific config files, e.g. "repo.desc" becomes "desc".

Good to know. And indeed, once I created a simple

# /path/to/repository/cgitrc

defbranch=main

the column was immediately populated with the proper data.