aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-10-09 06:56:14 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2012-10-17 16:30:09 +0200
commit521e10c884055c800078e6dada97ccf6c5193aad (patch)
treef4a8398b2d64b171de909d57893441830a280712 /cgit.c
parentc366bd6fa88fb7dbe1e42c84d56e2bda0b1682c5 (diff)
scan-tree: Unify gitweb.* and cgit.* settings into one config option.
After some back and forth with Jamie and René, it looks like the git config semantics are going to be like this: - gitweb.category maps to the cgit repo config key "section" - gitweb.description maps to the cgit repo config key "desc" - gitweb.owner maps to the cgit repo config key "owner" - cgit.* maps to all cgit repo config keys This option can be enabled with "enable-git-config=1", and replaces all previous "enable-gitweb-*" config keys. The order of operations is as follows: - git config settings are applied in the order that they exist in the git config file - if the owner is not set from git config, get the owner using the usual getpwuid call - if the description is not set from git config, look inside the static $path/description file - if section-from-path=1, override whatever previous settings were inside of git config using the section-from-path logic - parse $path/cgitrc for local repo.* settings, that override all previous settings
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/cgit.c b/cgit.c
index a8dda23..d699cb6 100644
--- a/cgit.c
+++ b/cgit.c
@@ -163,10 +163,6 @@ void config_cb(const char *name, const char *value)
ctx.cfg.snapshots = cgit_parse_snapshots_mask(value);
else if (!strcmp(name, "enable-filter-overrides"))
ctx.cfg.enable_filter_overrides = atoi(value);
- else if (!strcmp(name, "enable-gitweb-desc"))
- ctx.cfg.enable_gitweb_desc = atoi(value);
- else if (!strcmp(name, "enable-gitweb-owner"))
- ctx.cfg.enable_gitweb_owner = atoi(value);
else if (!strcmp(name, "enable-http-clone"))
ctx.cfg.enable_http_clone = atoi(value);
else if (!strcmp(name, "enable-index-links"))
@@ -183,6 +179,8 @@ void config_cb(const char *name, const char *value)
ctx.cfg.enable_subject_links = atoi(value);
else if (!strcmp(name, "enable-tree-linenumbers"))
ctx.cfg.enable_tree_linenumbers = atoi(value);
+ else if (!strcmp(name, "enable-git-config"))
+ ctx.cfg.enable_git_config = atoi(value);
else if (!strcmp(name, "max-stats"))
ctx.cfg.max_stats = cgit_find_stats_period(value, NULL);
else if (!strcmp(name, "cache-size"))
@@ -343,11 +341,9 @@ static void prepare_context(struct cgit_context *ctx)
ctx->cfg.css = "/cgit.css";
ctx->cfg.logo = "/cgit.png";
ctx->cfg.local_time = 0;
- ctx->cfg.enable_gitweb_desc = 1;
- ctx->cfg.enable_gitweb_owner = 1;
- ctx->cfg.enable_gitweb_section = 1;
ctx->cfg.enable_http_clone = 1;
ctx->cfg.enable_tree_linenumbers = 1;
+ ctx->cfg.enable_git_config = 0;
ctx->cfg.max_repo_count = 50;
ctx->cfg.max_commit_count = 50;
ctx->cfg.max_lock_attempts = 5;