summaryrefslogtreecommitdiffabout
path: root/cgit.c
Unidiff
Diffstat (limited to 'cgit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/cgit.c b/cgit.c
index 9452884..c263872 100644
--- a/cgit.c
+++ b/cgit.c
@@ -62,6 +62,8 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
62 repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); 62 repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value);
63 else if (!strcmp(name, "enable-remote-branches")) 63 else if (!strcmp(name, "enable-remote-branches"))
64 repo->enable_remote_branches = atoi(value); 64 repo->enable_remote_branches = atoi(value);
65 else if (!strcmp(name, "enable-subject-links"))
66 repo->enable_subject_links = atoi(value);
65 else if (!strcmp(name, "max-stats")) 67 else if (!strcmp(name, "max-stats"))
66 repo->max_stats = cgit_find_stats_period(value, NULL); 68 repo->max_stats = cgit_find_stats_period(value, NULL);
67 else if (!strcmp(name, "module-link")) 69 else if (!strcmp(name, "module-link"))
@@ -141,6 +143,8 @@ void config_cb(const char *name, const char *value)
141 ctx.cfg.enable_log_linecount = atoi(value); 143 ctx.cfg.enable_log_linecount = atoi(value);
142 else if (!strcmp(name, "enable-remote-branches")) 144 else if (!strcmp(name, "enable-remote-branches"))
143 ctx.cfg.enable_remote_branches = atoi(value); 145 ctx.cfg.enable_remote_branches = atoi(value);
146 else if (!strcmp(name, "enable-subject-links"))
147 ctx.cfg.enable_subject_links = atoi(value);
144 else if (!strcmp(name, "enable-tree-linenumbers")) 148 else if (!strcmp(name, "enable-tree-linenumbers"))
145 ctx.cfg.enable_tree_linenumbers = atoi(value); 149 ctx.cfg.enable_tree_linenumbers = atoi(value);
146 else if (!strcmp(name, "max-stats")) 150 else if (!strcmp(name, "max-stats"))
@@ -148,7 +152,7 @@ void config_cb(const char *name, const char *value)
148 else if (!strcmp(name, "cache-size")) 152 else if (!strcmp(name, "cache-size"))
149 ctx.cfg.cache_size = atoi(value); 153 ctx.cfg.cache_size = atoi(value);
150 else if (!strcmp(name, "cache-root")) 154 else if (!strcmp(name, "cache-root"))
151 ctx.cfg.cache_root = xstrdup(value); 155 ctx.cfg.cache_root = xstrdup(expand_macros(value));
152 else if (!strcmp(name, "cache-root-ttl")) 156 else if (!strcmp(name, "cache-root-ttl"))
153 ctx.cfg.cache_root_ttl = atoi(value); 157 ctx.cfg.cache_root_ttl = atoi(value);
154 else if (!strcmp(name, "cache-repo-ttl")) 158 else if (!strcmp(name, "cache-repo-ttl"))
@@ -165,6 +169,8 @@ void config_cb(const char *name, const char *value)
165 ctx.cfg.commit_filter = new_filter(value, 0); 169 ctx.cfg.commit_filter = new_filter(value, 0);
166 else if (!strcmp(name, "embedded")) 170 else if (!strcmp(name, "embedded"))
167 ctx.cfg.embedded = atoi(value); 171 ctx.cfg.embedded = atoi(value);
172 else if (!strcmp(name, "max-atom-items"))
173 ctx.cfg.max_atom_items = atoi(value);
168 else if (!strcmp(name, "max-message-length")) 174 else if (!strcmp(name, "max-message-length"))
169 ctx.cfg.max_msg_len = atoi(value); 175 ctx.cfg.max_msg_len = atoi(value);
170 else if (!strcmp(name, "max-repodesc-length")) 176 else if (!strcmp(name, "max-repodesc-length"))
@@ -177,9 +183,9 @@ void config_cb(const char *name, const char *value)
177 ctx.cfg.max_commit_count = atoi(value); 183 ctx.cfg.max_commit_count = atoi(value);
178 else if (!strcmp(name, "scan-path")) 184 else if (!strcmp(name, "scan-path"))
179 if (!ctx.cfg.nocache && ctx.cfg.cache_size) 185 if (!ctx.cfg.nocache && ctx.cfg.cache_size)
180 process_cached_repolist(value); 186 process_cached_repolist(expand_macros(value));
181 else 187 else
182 scan_tree(value, repo_config); 188 scan_tree(expand_macros(value), repo_config);
183 else if (!strcmp(name, "source-filter")) 189 else if (!strcmp(name, "source-filter"))
184 ctx.cfg.source_filter = new_filter(value, 1); 190 ctx.cfg.source_filter = new_filter(value, 1);
185 else if (!strcmp(name, "summary-log")) 191 else if (!strcmp(name, "summary-log"))
@@ -203,7 +209,7 @@ void config_cb(const char *name, const char *value)
203 else if (!prefixcmp(name, "mimetype.")) 209 else if (!prefixcmp(name, "mimetype."))
204 add_mimetype(name + 9, value); 210 add_mimetype(name + 9, value);
205 else if (!strcmp(name, "include")) 211 else if (!strcmp(name, "include"))
206 parse_configfile(value, config_cb); 212 parse_configfile(expand_macros(value), config_cb);
207} 213}
208 214
209static void querystring_cb(const char *name, const char *value) 215static void querystring_cb(const char *name, const char *value)
@@ -250,6 +256,8 @@ static void querystring_cb(const char *name, const char *value)
250 ctx.qry.period = xstrdup(value); 256 ctx.qry.period = xstrdup(value);
251 } else if (!strcmp(name, "ss")) { 257 } else if (!strcmp(name, "ss")) {
252 ctx.qry.ssdiff = atoi(value); 258 ctx.qry.ssdiff = atoi(value);
259 } else if (!strcmp(name, "all")) {
260 ctx.qry.show_all = atoi(value);
253 } else if (!strcmp(name, "context")) { 261 } else if (!strcmp(name, "context")) {
254 ctx.qry.context = atoi(value); 262 ctx.qry.context = atoi(value);
255 } else if (!strcmp(name, "ignorews")) { 263 } else if (!strcmp(name, "ignorews")) {
@@ -296,6 +304,7 @@ static void prepare_context(struct cgit_context *ctx)
296 ctx->cfg.summary_branches = 10; 304 ctx->cfg.summary_branches = 10;
297 ctx->cfg.summary_log = 10; 305 ctx->cfg.summary_log = 10;
298 ctx->cfg.summary_tags = 10; 306 ctx->cfg.summary_tags = 10;
307 ctx->cfg.max_atom_items = 10;
299 ctx->cfg.ssdiff = 0; 308 ctx->cfg.ssdiff = 0;
300 ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); 309 ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG"));
301 ctx->env.http_host = xstrdupn(getenv("HTTP_HOST")); 310 ctx->env.http_host = xstrdupn(getenv("HTTP_HOST"));
@@ -698,7 +707,7 @@ int main(int argc, const char **argv)
698 cgit_repolist.repos = NULL; 707 cgit_repolist.repos = NULL;
699 708
700 cgit_parse_args(argc, argv); 709 cgit_parse_args(argc, argv);
701 parse_configfile(ctx.env.cgit_config, config_cb); 710 parse_configfile(expand_macros(ctx.env.cgit_config), config_cb);
702 ctx.repo = NULL; 711 ctx.repo = NULL;
703 http_parse_querystring(ctx.qry.raw, querystring_cb); 712 http_parse_querystring(ctx.qry.raw, querystring_cb);
704 713