diff options
| -rw-r--r-- | cgit.c | 6 | ||||
| -rw-r--r-- | cgit.h | 2 | ||||
| -rw-r--r-- | cgitrc.5.txt | 10 | ||||
| -rw-r--r-- | shared.c | 3 | ||||
| -rw-r--r-- | ui-repolist.c | 2 |
5 files changed, 23 insertions, 0 deletions
| @@ -93,6 +93,10 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va | |||
| 93 | repo->email_filter = cgit_new_filter(value, EMAIL); | 93 | repo->email_filter = cgit_new_filter(value, EMAIL); |
| 94 | else if (!strcmp(name, "owner-filter")) | 94 | else if (!strcmp(name, "owner-filter")) |
| 95 | repo->owner_filter = cgit_new_filter(value, OWNER); | 95 | repo->owner_filter = cgit_new_filter(value, OWNER); |
| 96 | } else if (!strcmp(name, "hide")) { | ||
| 97 | repo->hide = atoi(value); | ||
| 98 | } else if (!strcmp(name, "ignore")) { | ||
| 99 | repo->ignore = atoi(value); | ||
| 96 | } | 100 | } |
| 97 | } | 101 | } |
| 98 | 102 | ||
| @@ -828,6 +832,8 @@ static void print_repo(FILE *f, struct cgit_repo *repo) | |||
| 828 | else if (repo->commit_sort == 2) | 832 | else if (repo->commit_sort == 2) |
| 829 | fprintf(f, "repo.commit-sort=topo\n"); | 833 | fprintf(f, "repo.commit-sort=topo\n"); |
| 830 | } | 834 | } |
| 835 | fprintf(f, "repo.hide=%d\n", repo->hide); | ||
| 836 | fprintf(f, "repo.ignore=%d\n", repo->ignore); | ||
| 831 | fprintf(f, "\n"); | 837 | fprintf(f, "\n"); |
| 832 | } | 838 | } |
| 833 | 839 | ||
| @@ -106,6 +106,8 @@ struct cgit_repo { | |||
| 106 | struct cgit_filter *email_filter; | 106 | struct cgit_filter *email_filter; |
| 107 | struct cgit_filter *owner_filter; | 107 | struct cgit_filter *owner_filter; |
| 108 | struct string_list submodules; | 108 | struct string_list submodules; |
| 109 | int hide; | ||
| 110 | int ignore; | ||
| 109 | }; | 111 | }; |
| 110 | 112 | ||
| 111 | typedef void (*repo_config_fn)(struct cgit_repo *repo, const char *name, | 113 | typedef void (*repo_config_fn)(struct cgit_repo *repo, const char *name, |
diff --git a/cgitrc.5.txt b/cgitrc.5.txt index be6703f..e21ece9 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt | |||
| @@ -509,6 +509,16 @@ repo.enable-subject-links:: | |||
| 509 | A flag which can be used to override the global setting | 509 | A flag which can be used to override the global setting |
| 510 | `enable-subject-links'. Default value: none. | 510 | `enable-subject-links'. Default value: none. |
| 511 | 511 | ||
| 512 | repo.hide:: | ||
| 513 | Flag which, when set to "1", hides the repository from the repository | ||
| 514 | index. The repository can still be accessed by providing a direct path. | ||
| 515 | Default value: "0". See also: "repo.ignore". | ||
| 516 | |||
| 517 | repo.ignore:: | ||
| 518 | Flag which, when set to "1", ignores the repository. The repository | ||
| 519 | is not shown in the index and cannot be accessed by providing a direct | ||
| 520 | path. Default value: "0". See also: "repo.hide". | ||
| 521 | |||
| 512 | repo.logo:: | 522 | repo.logo:: |
| 513 | Url which specifies the source of an image which will be used as a logo | 523 | Url which specifies the source of an image which will be used as a logo |
| 514 | on this repo's pages. Default value: global logo. | 524 | on this repo's pages. Default value: global logo. |
| @@ -75,6 +75,7 @@ struct cgit_repo *cgit_add_repo(const char *url) | |||
| 75 | ret->owner_filter = ctx.cfg.owner_filter; | 75 | ret->owner_filter = ctx.cfg.owner_filter; |
| 76 | ret->clone_url = ctx.cfg.clone_url; | 76 | ret->clone_url = ctx.cfg.clone_url; |
| 77 | ret->submodules.strdup_strings = 1; | 77 | ret->submodules.strdup_strings = 1; |
| 78 | ret->hide = ret->ignore = 0; | ||
| 78 | return ret; | 79 | return ret; |
| 79 | } | 80 | } |
| 80 | 81 | ||
| @@ -85,6 +86,8 @@ struct cgit_repo *cgit_get_repoinfo(const char *url) | |||
| 85 | 86 | ||
| 86 | for (i = 0; i < cgit_repolist.count; i++) { | 87 | for (i = 0; i < cgit_repolist.count; i++) { |
| 87 | repo = &cgit_repolist.repos[i]; | 88 | repo = &cgit_repolist.repos[i]; |
| 89 | if (repo->ignore) | ||
| 90 | continue; | ||
| 88 | if (!strcmp(repo->url, url)) | 91 | if (!strcmp(repo->url, url)) |
| 89 | return repo; | 92 | return repo; |
| 90 | } | 93 | } |
diff --git a/ui-repolist.c b/ui-repolist.c index f929cb7..91911e0 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
| @@ -275,6 +275,8 @@ void cgit_print_repolist() | |||
| 275 | html("<table summary='repository list' class='list nowrap'>"); | 275 | html("<table summary='repository list' class='list nowrap'>"); |
| 276 | for (i = 0; i < cgit_repolist.count; i++) { | 276 | for (i = 0; i < cgit_repolist.count; i++) { |
| 277 | ctx.repo = &cgit_repolist.repos[i]; | 277 | ctx.repo = &cgit_repolist.repos[i]; |
| 278 | if (ctx.repo->hide || ctx.repo->ignore) | ||
| 279 | continue; | ||
| 278 | if (!(is_match(ctx.repo) && is_in_url(ctx.repo))) | 280 | if (!(is_match(ctx.repo) && is_in_url(ctx.repo))) |
| 279 | continue; | 281 | continue; |
| 280 | hits++; | 282 | hits++; |
