diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2012-10-09 19:56:14 (JST) |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2012-10-17 23:30:09 (JST) |
commit | 521e10c884055c800078e6dada97ccf6c5193aad (patch) | |
tree | f4a8398b2d64b171de909d57893441830a280712 /cgit.c | |
parent | c366bd6fa88fb7dbe1e42c84d56e2bda0b1682c5 (diff) | |
download | cgit-521e10c884055c800078e6dada97ccf6c5193aad.zip cgit-521e10c884055c800078e6dada97ccf6c5193aad.tar.gz |
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.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -163,10 +163,6 @@ void config_cb(const char *name, const char *value) | |||
163 | ctx.cfg.snapshots = cgit_parse_snapshots_mask(value); | 163 | ctx.cfg.snapshots = cgit_parse_snapshots_mask(value); |
164 | else if (!strcmp(name, "enable-filter-overrides")) | 164 | else if (!strcmp(name, "enable-filter-overrides")) |
165 | ctx.cfg.enable_filter_overrides = atoi(value); | 165 | ctx.cfg.enable_filter_overrides = atoi(value); |
166 | else if (!strcmp(name, "enable-gitweb-desc")) | ||
167 | ctx.cfg.enable_gitweb_desc = atoi(value); | ||
168 | else if (!strcmp(name, "enable-gitweb-owner")) | ||
169 | ctx.cfg.enable_gitweb_owner = atoi(value); | ||
170 | else if (!strcmp(name, "enable-http-clone")) | 166 | else if (!strcmp(name, "enable-http-clone")) |
171 | ctx.cfg.enable_http_clone = atoi(value); | 167 | ctx.cfg.enable_http_clone = atoi(value); |
172 | else if (!strcmp(name, "enable-index-links")) | 168 | else if (!strcmp(name, "enable-index-links")) |
@@ -183,6 +179,8 @@ void config_cb(const char *name, const char *value) | |||
183 | ctx.cfg.enable_subject_links = atoi(value); | 179 | ctx.cfg.enable_subject_links = atoi(value); |
184 | else if (!strcmp(name, "enable-tree-linenumbers")) | 180 | else if (!strcmp(name, "enable-tree-linenumbers")) |
185 | ctx.cfg.enable_tree_linenumbers = atoi(value); | 181 | ctx.cfg.enable_tree_linenumbers = atoi(value); |
182 | else if (!strcmp(name, "enable-git-config")) | ||
183 | ctx.cfg.enable_git_config = atoi(value); | ||
186 | else if (!strcmp(name, "max-stats")) | 184 | else if (!strcmp(name, "max-stats")) |
187 | ctx.cfg.max_stats = cgit_find_stats_period(value, NULL); | 185 | ctx.cfg.max_stats = cgit_find_stats_period(value, NULL); |
188 | else if (!strcmp(name, "cache-size")) | 186 | else if (!strcmp(name, "cache-size")) |
@@ -343,11 +341,9 @@ static void prepare_context(struct cgit_context *ctx) | |||
343 | ctx->cfg.css = "/cgit.css"; | 341 | ctx->cfg.css = "/cgit.css"; |
344 | ctx->cfg.logo = "/cgit.png"; | 342 | ctx->cfg.logo = "/cgit.png"; |
345 | ctx->cfg.local_time = 0; | 343 | ctx->cfg.local_time = 0; |
346 | ctx->cfg.enable_gitweb_desc = 1; | ||
347 | ctx->cfg.enable_gitweb_owner = 1; | ||
348 | ctx->cfg.enable_gitweb_section = 1; | ||
349 | ctx->cfg.enable_http_clone = 1; | 344 | ctx->cfg.enable_http_clone = 1; |
350 | ctx->cfg.enable_tree_linenumbers = 1; | 345 | ctx->cfg.enable_tree_linenumbers = 1; |
346 | ctx->cfg.enable_git_config = 0; | ||
351 | ctx->cfg.max_repo_count = 50; | 347 | ctx->cfg.max_repo_count = 50; |
352 | ctx->cfg.max_commit_count = 50; | 348 | ctx->cfg.max_commit_count = 50; |
353 | ctx->cfg.max_lock_attempts = 5; | 349 | ctx->cfg.max_lock_attempts = 5; |