Add repo.hide and repo.ignore These options can be used to hide a repository from the index or completely ignore a repository, respectively. They are particularly useful when used in combination with scan-path. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Lukas Fleischer cgit@cryptocrack.de
Thu, 29 Jan 2015 12:52:49 +0100
5 files changed,
23 insertions(+),
0 deletions(-)
M
cgit.c
→
cgit.c
@@ -93,6 +93,10 @@ else if (!strcmp(name, "email-filter"))
repo->email_filter = cgit_new_filter(value, EMAIL); else if (!strcmp(name, "owner-filter")) repo->owner_filter = cgit_new_filter(value, OWNER); + } else if (!strcmp(name, "hide")) { + repo->hide = atoi(value); + } else if (!strcmp(name, "ignore")) { + repo->ignore = atoi(value); } }@@ -828,6 +832,8 @@ fprintf(f, "repo.commit-sort=date\n");
else if (repo->commit_sort == 2) fprintf(f, "repo.commit-sort=topo\n"); } + fprintf(f, "repo.hide=%d\n", repo->hide); + fprintf(f, "repo.ignore=%d\n", repo->ignore); fprintf(f, "\n"); }
M
cgitrc.5.txt
→
cgitrc.5.txt
@@ -509,6 +509,16 @@ repo.enable-subject-links::
A flag which can be used to override the global setting `enable-subject-links'. Default value: none. +repo.hide:: + Flag which, when set to "1", hides the repository from the repository + index. The repository can still be accessed by providing a direct path. + Default value: "0". See also: "repo.ignore". + +repo.ignore:: + Flag which, when set to "1", ignores the repository. The repository + is not shown in the index and cannot be accessed by providing a direct + path. Default value: "0". See also: "repo.hide". + repo.logo:: Url which specifies the source of an image which will be used as a logo on this repo's pages. Default value: global logo.
M
ui-repolist.c
→
ui-repolist.c
@@ -275,6 +275,8 @@
html("<table summary='repository list' class='list nowrap'>"); for (i = 0; i < cgit_repolist.count; i++) { ctx.repo = &cgit_repolist.repos[i]; + if (ctx.repo->hide || ctx.repo->ignore) + continue; if (!(is_match(ctx.repo) && is_in_url(ctx.repo))) continue; hits++;