From ffd23bfd13a2f009f4c1c6b355a5f895969f81fd Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Mon, 20 Jul 2026 10:18:48 -1000 Subject: Gate the stats page and add a language breakdown `max-stats` only bounds the selectable periods now and no longer doubles as the enable switch. The tree walk runs before the history walk on purpose. Releasing commit memory while walking history resets each commit slab index, and a commit graph lookup afterwards would read another commit slot and walk the wrong tree. The stats fixture writes a commit graph so the tests cover that path. The history walk bounds the window in process rather than passing a formatted since date to `setup_revisions`, and parses each commit once. --- cgitrc.5.txt | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'cgitrc.5.txt') diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 5644aa7..afad0d5 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -220,6 +220,11 @@ enable-remote-branches:: in the summary and refs views. Default value: "0". See also: "repo.enable-remote-branches". +enable-stats:: + Flag which, when set to "1", enables the statistics page, with the + language breakdown and the commits-per-author table. Default + value: "0". See also: "repo.enable-stats", "max-stats". + enable-subject-links:: Flag which, when set to "1", will make cgit use the subject of the parent commit as link text when generating links to parent commits @@ -330,9 +335,11 @@ max-repodesc-length:: on the repository index page. Default value: "80". max-stats:: - Set the default maximum statistics period. Valid values are "week", - "month", "quarter" and "year". If unspecified, statistics are - disabled. Default value: none. See also: "repo.max-stats". + Bound the coarsest period selectable on the statistics page. Valid + values are "week", "month", "quarter" and "year". Unset, every + period is offered. This option no longer enables the page, that is + what "enable-stats" does. Default value: none. See also: + "enable-stats", "repo.max-stats". mimetype.:: Set the mimetype for the specified filename extension. This is used @@ -564,6 +571,10 @@ repo.enable-remote-branches:: Flag which, when set to "1", will make cgit display remote branches in the summary and refs views. Default value: . +repo.enable-stats:: + A flag which can be used to override the global setting + `enable-stats'. Default value: none. + repo.enable-subject-links:: A flag which can be used to override the global setting `enable-subject-links'. Default value: none. -- cgit v2.8.0