-rw-r--r-- | cgit.c | 43 |
1 files changed, 38 insertions, 5 deletions
@@ -62,2 +62,6 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value) repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); + else if (!strcmp(name, "enable-remote-branches")) + repo->enable_remote_branches = atoi(value); + else if (!strcmp(name, "enable-subject-links")) + repo->enable_subject_links = atoi(value); else if (!strcmp(name, "max-stats")) @@ -139,2 +143,6 @@ void config_cb(const char *name, const char *value) ctx.cfg.enable_log_linecount = atoi(value); + else if (!strcmp(name, "enable-remote-branches")) + ctx.cfg.enable_remote_branches = atoi(value); + else if (!strcmp(name, "enable-subject-links")) + ctx.cfg.enable_subject_links = atoi(value); else if (!strcmp(name, "enable-tree-linenumbers")) @@ -146,3 +154,3 @@ void config_cb(const char *name, const char *value) else if (!strcmp(name, "cache-root")) - ctx.cfg.cache_root = xstrdup(value); + ctx.cfg.cache_root = xstrdup(expand_macros(value)); else if (!strcmp(name, "cache-root-ttl")) @@ -163,2 +171,4 @@ void config_cb(const char *name, const char *value) ctx.cfg.embedded = atoi(value); + else if (!strcmp(name, "max-atom-items")) + ctx.cfg.max_atom_items = atoi(value); else if (!strcmp(name, "max-message-length")) @@ -167,2 +177,4 @@ void config_cb(const char *name, const char *value) ctx.cfg.max_repodesc_len = atoi(value); + else if (!strcmp(name, "max-blob-size")) + ctx.cfg.max_blob_size = atoi(value); else if (!strcmp(name, "max-repo-count")) @@ -173,5 +185,5 @@ void config_cb(const char *name, const char *value) if (!ctx.cfg.nocache && ctx.cfg.cache_size) - process_cached_repolist(value); + process_cached_repolist(expand_macros(value)); else - scan_tree(value, repo_config); + scan_tree(expand_macros(value), repo_config); else if (!strcmp(name, "source-filter")) @@ -184,2 +196,4 @@ void config_cb(const char *name, const char *value) ctx.cfg.summary_tags = atoi(value); + else if (!strcmp(name, "side-by-side-diffs")) + ctx.cfg.ssdiff = atoi(value); else if (!strcmp(name, "agefile")) @@ -197,3 +211,3 @@ void config_cb(const char *name, const char *value) else if (!strcmp(name, "include")) - parse_configfile(value, config_cb); + parse_configfile(expand_macros(value), config_cb); } @@ -211,2 +225,4 @@ static void querystring_cb(const char *name, const char *value) } else if (!strcmp(name, "url")) { + if (*value == '/') + value++; ctx.qry.url = xstrdup(value); @@ -240,2 +256,10 @@ static void querystring_cb(const char *name, const char *value) ctx.qry.period = xstrdup(value); + } else if (!strcmp(name, "ss")) { + ctx.qry.ssdiff = atoi(value); + } else if (!strcmp(name, "all")) { + ctx.qry.show_all = atoi(value); + } else if (!strcmp(name, "context")) { + ctx.qry.context = atoi(value); + } else if (!strcmp(name, "ignorews")) { + ctx.qry.ignorews = atoi(value); } @@ -270,2 +294,3 @@ static void prepare_context(struct cgit_context *ctx) ctx->cfg.max_repodesc_len = 80; + ctx->cfg.max_blob_size = 0; ctx->cfg.max_stats = 0; @@ -281,2 +306,4 @@ static void prepare_context(struct cgit_context *ctx) ctx->cfg.summary_tags = 10; + ctx->cfg.max_atom_items = 10; + ctx->cfg.ssdiff = 0; ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); @@ -412,2 +439,8 @@ static void process_request(void *cbdata) + /* If cmd->want_vpath is set, assume ctx->qry.path contains a "virtual" + * in-project path limit to be made available at ctx->qry.vpath. + * Otherwise, no path limit is in effect (ctx->qry.vpath = NULL). + */ + ctx->qry.vpath = cmd->want_vpath ? ctx->qry.path : NULL; + if (cmd->want_repo && !ctx->repo) { @@ -676,3 +709,3 @@ int main(int argc, const char **argv) cgit_parse_args(argc, argv); - parse_configfile(ctx.env.cgit_config, config_cb); + parse_configfile(expand_macros(ctx.env.cgit_config), config_cb); ctx.repo = NULL; |