X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/17838ec6304198811df97402f11c185f8f0e10bd..8eef4589d0ba80fd4e6a9ce2f3ca4fcf266a64e0:/cgit.c
diff --git a/cgit.c b/cgit.c
index 796cb7f..c16ed8c 100644
--- a/cgit.c
+++ b/cgit.c
@@ -91,6 +91,12 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va
repo->source_filter = cgit_new_filter(value, SOURCE);
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);
}
}
@@ -194,6 +200,8 @@ static void config_cb(const char *name, const char *value)
ctx.cfg.commit_filter = cgit_new_filter(value, COMMIT);
else if (!strcmp(name, "email-filter"))
ctx.cfg.email_filter = cgit_new_filter(value, EMAIL);
+ else if (!strcmp(name, "owner-filter"))
+ ctx.cfg.owner_filter = cgit_new_filter(value, OWNER);
else if (!strcmp(name, "auth-filter"))
ctx.cfg.auth_filter = cgit_new_filter(value, AUTH);
else if (!strcmp(name, "embedded"))
@@ -528,6 +536,17 @@ static void choose_readme(struct cgit_repo *repo)
string_list_append(&repo->readme, filename)->util = ref;
}
+static void print_no_repo_clone_urls(const char *url)
+{
+ html("
| ");
+ html_txt(url);
+ html(" |
\n");
+}
+
static int prepare_repo_cmd(void)
{
unsigned char sha1[20];
@@ -578,6 +597,11 @@ static int prepare_repo_cmd(void)
cgit_print_docstart();
cgit_print_pageheader();
cgit_print_error("Repository seems to be empty");
+ if (!strcmp(ctx.qry.page, "summary")) {
+ html("| |
| Clone |
\n");
+ cgit_add_clone_urls(print_no_repo_clone_urls);
+ html("
\n");
+ }
cgit_print_docend();
return 1;
}
@@ -595,7 +619,7 @@ static int prepare_repo_cmd(void)
free(tmp);
return 1;
}
- sort_string_list(&ctx.repo->submodules);
+ string_list_sort(&ctx.repo->submodules);
cgit_prepare_repo_env(ctx.repo);
choose_readme(ctx.repo);
return 0;
@@ -800,6 +824,8 @@ static void print_repo(FILE *f, struct cgit_repo *repo)
cgit_fprintf_filter(repo->source_filter, f, "repo.source-filter=");
if (repo->email_filter && repo->email_filter != ctx.cfg.email_filter)
cgit_fprintf_filter(repo->email_filter, f, "repo.email-filter=");
+ if (repo->owner_filter && repo->owner_filter != ctx.cfg.owner_filter)
+ cgit_fprintf_filter(repo->owner_filter, f, "repo.owner-filter=");
if (repo->snapshots != ctx.cfg.snapshots) {
char *tmp = build_snapshot_setting(repo->snapshots);
fprintf(f, "repo.snapshots=%s\n", tmp ? tmp : "");
@@ -822,6 +848,8 @@ static void print_repo(FILE *f, struct cgit_repo *repo)
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");
}
@@ -985,7 +1013,7 @@ static void cgit_parse_args(int argc, const char **argv)
}
}
-static int calc_ttl()
+static int calc_ttl(void)
{
if (!ctx.repo)
return ctx.cfg.cache_root_ttl;