]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
Add a 'stats' page to each repo
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index c82587b68b8cc5169f4265eaad98fbc938aa0b8e..22b6d7cb09d0bc1085aba5f14efdfac6e3b3bfb9 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -54,6 +54,8 @@ void config_cb(const char *name, const char *value)
                ctx.cfg.enable_log_filecount = atoi(value);
        else if (!strcmp(name, "enable-log-linecount"))
                ctx.cfg.enable_log_linecount = atoi(value);
+       else if (!strcmp(name, "enable-stats"))
+               ctx.cfg.enable_stats = atoi(value);
        else if (!strcmp(name, "cache-size"))
                ctx.cfg.cache_size = atoi(value);
        else if (!strcmp(name, "cache-root"))
@@ -112,6 +114,8 @@ void config_cb(const char *name, const char *value)
                ctx.repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value);
        else if (ctx.repo && !strcmp(name, "repo.enable-log-linecount"))
                ctx.repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value);
+       else if (ctx.repo && !strcmp(name, "repo.enable-stats"))
+               ctx.repo->enable_stats = ctx.cfg.enable_stats && atoi(value);
        else if (ctx.repo && !strcmp(name, "repo.module-link"))
                ctx.repo->module_link= xstrdup(value);
        else if (ctx.repo && !strcmp(name, "repo.readme") && value != NULL) {
@@ -154,6 +158,8 @@ static void querystring_cb(const char *name, const char *value)
                ctx.qry.name = xstrdup(value);
        } else if (!strcmp(name, "mimetype")) {
                ctx.qry.mimetype = xstrdup(value);
+       } else if (!strcmp(name, "period")) {
+               ctx.qry.period = xstrdup(value);
        }
 }