]> git.cameronkatri.com Git - cgit.git/blobdiff - cgit.c
Merge branch 'br/misc'
[cgit.git] / cgit.c
diff --git a/cgit.c b/cgit.c
index d6146e2270737806513b0ceca0e187475f93c121..916feb4f10dd3f128a10381d39f139cfa318b9a9 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -57,6 +57,8 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
                repo->defbranch = xstrdup(value);
        else if (!strcmp(name, "snapshots"))
                repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value);
+       else if (!strcmp(name, "enable-commit-graph"))
+               repo->enable_commit_graph = ctx.cfg.enable_commit_graph * atoi(value);
        else if (!strcmp(name, "enable-log-filecount"))
                repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value);
        else if (!strcmp(name, "enable-log-linecount"))
@@ -71,13 +73,13 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
                repo->module_link= xstrdup(value);
        else if (!strcmp(name, "section"))
                repo->section = xstrdup(value);
-       else if (!strcmp(name, "readme") && value != NULL) {
-               char *colon;
-               if (*value == '/' || ((colon = strchr(value, ':')) != NULL && colon != value && *(colon + 1) != '\0'))
-                       repo->readme = xstrdup(value);
-               else
-                       repo->readme = xstrdup(fmt("%s/%s", repo->path, value));
-       else if (ctx.cfg.enable_filter_overrides) {
+       else if (!strcmp(name, "readme") && value != NULL)
+               repo->readme = xstrdup(value);
+       else if (!strcmp(name, "logo") && value != NULL)
+               repo->logo = xstrdup(value);
+       else if (!strcmp(name, "logo-link") && value != NULL)
+               repo->logo_link = xstrdup(value);
+       else if (ctx.cfg.enable_filter_overrides) {
                if (!strcmp(name, "about-filter"))
                        repo->about_filter = new_filter(value, 0);
                else if (!strcmp(name, "commit-filter"))
@@ -97,6 +99,8 @@ void config_cb(const char *name, const char *value)
                ctx.repo->path = trim_end(value, '/');
        else if (ctx.repo && !prefixcmp(name, "repo."))
                repo_config(ctx.repo, name + 5, value);
+       else if (!strcmp(name, "readme"))
+               ctx.cfg.readme = xstrdup(value);
        else if (!strcmp(name, "root-title"))
                ctx.cfg.root_title = xstrdup(value);
        else if (!strcmp(name, "root-desc"))
@@ -123,6 +127,8 @@ void config_cb(const char *name, const char *value)
                ctx.cfg.logo_link = xstrdup(value);
        else if (!strcmp(name, "module-link"))
                ctx.cfg.module_link = xstrdup(value);
+       else if (!strcmp(name, "strict-export"))
+               ctx.cfg.strict_export = xstrdup(value);
        else if (!strcmp(name, "virtual-root")) {
                ctx.cfg.virtual_root = trim_end(value, '/');
                if (!ctx.cfg.virtual_root && (!strcmp(value, "/")))
@@ -141,6 +147,8 @@ void config_cb(const char *name, const char *value)
                ctx.cfg.enable_gitweb_owner = atoi(value);
        else if (!strcmp(name, "enable-index-links"))
                ctx.cfg.enable_index_links = atoi(value);
+       else if (!strcmp(name, "enable-commit-graph"))
+               ctx.cfg.enable_commit_graph = atoi(value);
        else if (!strcmp(name, "enable-log-filecount"))
                ctx.cfg.enable_log_filecount = atoi(value);
        else if (!strcmp(name, "enable-log-linecount"))
@@ -195,6 +203,10 @@ void config_cb(const char *name, const char *value)
                                      ctx.cfg.project_list, repo_config);
                else
                        scan_tree(expand_macros(value), repo_config);
+       else if (!strcmp(name, "scan-hidden-path"))
+               ctx.cfg.scan_hidden_path = atoi(value);
+       else if (!strcmp(name, "section-from-path"))
+               ctx.cfg.section_from_path = atoi(value);
        else if (!strcmp(name, "source-filter"))
                ctx.cfg.source_filter = new_filter(value, 1);
        else if (!strcmp(name, "summary-log"))
@@ -313,6 +325,7 @@ static void prepare_context(struct cgit_context *ctx)
        ctx->cfg.robots = "index, nofollow";
        ctx->cfg.root_title = "Git repository browser";
        ctx->cfg.root_desc = "a fast webinterface for the git dscm";
+       ctx->cfg.scan_hidden_path = 0;
        ctx->cfg.script_name = CGIT_SCRIPT_NAME;
        ctx->cfg.section = "";
        ctx->cfg.summary_branches = 10;
@@ -538,6 +551,8 @@ void print_repo(FILE *f, struct cgit_repo *repo)
                fprintf(f, "repo.section=%s\n", repo->section);
        if (repo->clone_url)
                fprintf(f, "repo.clone-url=%s\n", repo->clone_url);
+       fprintf(f, "repo.enable-commit-graph=%d\n",
+               repo->enable_commit_graph);
        fprintf(f, "repo.enable-log-filecount=%d\n",
                repo->enable_log_filecount);
        fprintf(f, "repo.enable-log-linecount=%d\n",
@@ -610,7 +625,7 @@ static void process_cached_repolist(const char *path)
        hash = hash_str(path);
        if (ctx.cfg.project_list)
                hash += hash_str(ctx.cfg.project_list);
-       cached_rc = xstrdup(fmt("%s/rc-%8x", ctx.cfg.cache_root, hash));
+       cached_rc = xstrdup(fmt("%s/rc-%8lx", ctx.cfg.cache_root, hash));
 
        if (stat(cached_rc, &st)) {
                /* Nothing is cached, we need to scan without forking. And