commit c6c5c5fd9c8ee7a991803e2a8221453bd04f6153 from: Omar Polo via: Thomas Adam date: Sat Dec 30 18:51:43 2023 UTC gotwebd: retire max_repos setting Unlike max_repos_display which limits the number of items per page, max_repos is an hard-limit on the number of repos gotwebd would process. "kill it with fire" tracey@ about the idea ok stsp commit - b2d220cf5cce7755b132e4a26b7cde2cbdc09cba commit + c6c5c5fd9c8ee7a991803e2a8221453bd04f6153 blob - 81932fc95c4d74b1c3b2af23037fefc435fb69da blob + 47ed16a48254887578b69ac0f2248761f6ac5250 --- gotwebd/gotweb.c +++ gotwebd/gotweb.c @@ -791,9 +791,6 @@ gotweb_render_index(struct template *tp) return -1; for (d_i = 0; d_i < t->nrepos; d_i++) { - if (srv->max_repos > 0 && t->prev_disp == srv->max_repos) - break; - if (strcmp(sd_dent[d_i]->d_name, ".") == 0 || strcmp(sd_dent[d_i]->d_name, "..") == 0) { d_skipped++; @@ -847,11 +844,7 @@ gotweb_render_index(struct template *tp) } t->repos_total = t->nrepos - d_skipped; - if (srv->max_repos_display == 0) - return 0; - if (srv->max_repos > 0 && srv->max_repos < srv->max_repos_display) - return 0; - if (t->repos_total <= srv->max_repos || + if (srv->max_repos_display == 0 || t->repos_total <= srv->max_repos_display) return 0; blob - 97c8523a4a1c12d8bfa0da8c719c17fc93523304 blob + 2c4a828f3b8cde396a60854daae3bbc690ecdfd3 --- gotwebd/gotwebd.conf.5 +++ gotwebd/gotwebd.conf.5 @@ -123,11 +123,6 @@ Defaults to .It Ic max_commits_display Ar number Set the maximum amount of commits and tags displayed per page. Defaults to 25. -.It Ic max_repos Ar number -Set the maximum amount of repositories -.Xr gotwebd 8 -will work with. -Defaults to 0, showing all repositories. .It Ic max_repos_display Ar number Set the maximum amount of repositories displayed on the index screen. Defaults to 25. blob - d8c7c9c630d74c1b2acde77f1cd158400dedd993 blob + 207c4dbc424493d3ff719acc1447d3cad5906547 --- gotwebd/gotwebd.h +++ gotwebd/gotwebd.h @@ -77,7 +77,6 @@ #define D_SHOWDESC 1 #define D_SHOWURL 1 #define D_RESPECTEXPORTOK 0 -#define D_MAXREPO 0 #define D_MAXREPODISP 25 #define D_MAXSLCOMMDISP 10 #define D_MAXCOMMITDISP 25 @@ -300,7 +299,6 @@ struct server { char logo_url[GOTWEBD_MAXTEXT]; char custom_css[PATH_MAX]; - size_t max_repos; size_t max_repos_display; size_t max_commits_display; size_t summary_commits_display; blob - ac8d5fb0175cfb20d850c15e6a83c221e6edcaa2 blob + 93979865f4ad834239ef20b16f08a34de6220396 --- gotwebd/parse.y +++ gotwebd/parse.y @@ -109,7 +109,7 @@ typedef struct { %} -%token LISTEN WWW_PATH MAX_REPOS SITE_NAME SITE_OWNER SITE_LINK LOGO +%token LISTEN WWW_PATH SITE_NAME SITE_OWNER SITE_LINK LOGO %token LOGO_URL SHOW_REPO_OWNER SHOW_REPO_AGE SHOW_REPO_DESCRIPTION %token MAX_REPOS_DISPLAY REPOS_PATH MAX_COMMITS_DISPLAY ON ERROR %token SHOW_SITE_OWNER SHOW_REPO_CLONEURL PORT PREFORK RESPECT_EXPORTOK @@ -369,13 +369,6 @@ serveropts1 : REPOS_PATH STRING { } free($4); } - | MAX_REPOS NUMBER { - if ($2 <= 0) { - yyerror("max_repos is too small: %lld", $2); - YYERROR; - } - new_srv->max_repos = $2; - } | SHOW_SITE_OWNER boolean { new_srv->show_site_owner = $2; } @@ -479,7 +472,6 @@ lookup(char *s) { "logo", LOGO }, { "logo_url", LOGO_URL }, { "max_commits_display", MAX_COMMITS_DISPLAY }, - { "max_repos", MAX_REPOS }, { "max_repos_display", MAX_REPOS_DISPLAY }, { "on", ON }, { "port", PORT }, @@ -931,7 +923,6 @@ conf_new_server(const char *name) srv->max_commits_display = D_MAXCOMMITDISP; srv->summary_commits_display = D_MAXSLCOMMDISP; srv->summary_tags_display = D_MAXSLTAGDISP; - srv->max_repos = D_MAXREPO; srv->unix_socket = 1; srv->fcgi_socket = 0;