|
diff --git a/cgit.c b/cgit.c index e8c1f94..916feb4 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -36,48 +36,50 @@ struct cgit_filter *new_filter(const char *cmd, int extra_args) |
36 | f = xmalloc(sizeof(struct cgit_filter)); |
36 | f = xmalloc(sizeof(struct cgit_filter)); |
37 | f->cmd = xstrdup(cmd); |
37 | f->cmd = xstrdup(cmd); |
38 | f->argv = xmalloc((2 + extra_args) * sizeof(char *)); |
38 | f->argv = xmalloc((2 + extra_args) * sizeof(char *)); |
39 | f->argv[0] = f->cmd; |
39 | f->argv[0] = f->cmd; |
40 | f->argv[1] = NULL; |
40 | f->argv[1] = NULL; |
41 | return f; |
41 | return f; |
42 | } |
42 | } |
43 | |
43 | |
44 | static void process_cached_repolist(const char *path); |
44 | static void process_cached_repolist(const char *path); |
45 | |
45 | |
46 | void repo_config(struct cgit_repo *repo, const char *name, const char *value) |
46 | void repo_config(struct cgit_repo *repo, const char *name, const char *value) |
47 | { |
47 | { |
48 | if (!strcmp(name, "name")) |
48 | if (!strcmp(name, "name")) |
49 | repo->name = xstrdup(value); |
49 | repo->name = xstrdup(value); |
50 | else if (!strcmp(name, "clone-url")) |
50 | else if (!strcmp(name, "clone-url")) |
51 | repo->clone_url = xstrdup(value); |
51 | repo->clone_url = xstrdup(value); |
52 | else if (!strcmp(name, "desc")) |
52 | else if (!strcmp(name, "desc")) |
53 | repo->desc = xstrdup(value); |
53 | repo->desc = xstrdup(value); |
54 | else if (!strcmp(name, "owner")) |
54 | else if (!strcmp(name, "owner")) |
55 | repo->owner = xstrdup(value); |
55 | repo->owner = xstrdup(value); |
56 | else if (!strcmp(name, "defbranch")) |
56 | else if (!strcmp(name, "defbranch")) |
57 | repo->defbranch = xstrdup(value); |
57 | repo->defbranch = xstrdup(value); |
58 | else if (!strcmp(name, "snapshots")) |
58 | else if (!strcmp(name, "snapshots")) |
59 | repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value); |
59 | repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value); |
| |
60 | else if (!strcmp(name, "enable-commit-graph")) |
| |
61 | repo->enable_commit_graph = ctx.cfg.enable_commit_graph * atoi(value); |
60 | else if (!strcmp(name, "enable-log-filecount")) |
62 | else if (!strcmp(name, "enable-log-filecount")) |
61 | repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); |
63 | repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); |
62 | else if (!strcmp(name, "enable-log-linecount")) |
64 | else if (!strcmp(name, "enable-log-linecount")) |
63 | repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); |
65 | repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); |
64 | else if (!strcmp(name, "enable-remote-branches")) |
66 | else if (!strcmp(name, "enable-remote-branches")) |
65 | repo->enable_remote_branches = atoi(value); |
67 | repo->enable_remote_branches = atoi(value); |
66 | else if (!strcmp(name, "enable-subject-links")) |
68 | else if (!strcmp(name, "enable-subject-links")) |
67 | repo->enable_subject_links = atoi(value); |
69 | repo->enable_subject_links = atoi(value); |
68 | else if (!strcmp(name, "max-stats")) |
70 | else if (!strcmp(name, "max-stats")) |
69 | repo->max_stats = cgit_find_stats_period(value, NULL); |
71 | repo->max_stats = cgit_find_stats_period(value, NULL); |
70 | else if (!strcmp(name, "module-link")) |
72 | else if (!strcmp(name, "module-link")) |
71 | repo->module_link= xstrdup(value); |
73 | repo->module_link= xstrdup(value); |
72 | else if (!strcmp(name, "section")) |
74 | else if (!strcmp(name, "section")) |
73 | repo->section = xstrdup(value); |
75 | repo->section = xstrdup(value); |
74 | else if (!strcmp(name, "readme") && value != NULL) |
76 | else if (!strcmp(name, "readme") && value != NULL) |
75 | repo->readme = xstrdup(value); |
77 | repo->readme = xstrdup(value); |
76 | else if (!strcmp(name, "logo") && value != NULL) |
78 | else if (!strcmp(name, "logo") && value != NULL) |
77 | repo->logo = xstrdup(value); |
79 | repo->logo = xstrdup(value); |
78 | else if (!strcmp(name, "logo-link") && value != NULL) |
80 | else if (!strcmp(name, "logo-link") && value != NULL) |
79 | repo->logo_link = xstrdup(value); |
81 | repo->logo_link = xstrdup(value); |
80 | else if (ctx.cfg.enable_filter_overrides) { |
82 | else if (ctx.cfg.enable_filter_overrides) { |
81 | if (!strcmp(name, "about-filter")) |
83 | if (!strcmp(name, "about-filter")) |
82 | repo->about_filter = new_filter(value, 0); |
84 | repo->about_filter = new_filter(value, 0); |
83 | else if (!strcmp(name, "commit-filter")) |
85 | else if (!strcmp(name, "commit-filter")) |
@@ -124,48 +126,50 @@ void config_cb(const char *name, const char *value) |
124 | else if (!strcmp(name, "logo-link")) |
126 | else if (!strcmp(name, "logo-link")) |
125 | ctx.cfg.logo_link = xstrdup(value); |
127 | ctx.cfg.logo_link = xstrdup(value); |
126 | else if (!strcmp(name, "module-link")) |
128 | else if (!strcmp(name, "module-link")) |
127 | ctx.cfg.module_link = xstrdup(value); |
129 | ctx.cfg.module_link = xstrdup(value); |
128 | else if (!strcmp(name, "strict-export")) |
130 | else if (!strcmp(name, "strict-export")) |
129 | ctx.cfg.strict_export = xstrdup(value); |
131 | ctx.cfg.strict_export = xstrdup(value); |
130 | else if (!strcmp(name, "virtual-root")) { |
132 | else if (!strcmp(name, "virtual-root")) { |
131 | ctx.cfg.virtual_root = trim_end(value, '/'); |
133 | ctx.cfg.virtual_root = trim_end(value, '/'); |
132 | if (!ctx.cfg.virtual_root && (!strcmp(value, "/"))) |
134 | if (!ctx.cfg.virtual_root && (!strcmp(value, "/"))) |
133 | ctx.cfg.virtual_root = ""; |
135 | ctx.cfg.virtual_root = ""; |
134 | } else if (!strcmp(name, "nocache")) |
136 | } else if (!strcmp(name, "nocache")) |
135 | ctx.cfg.nocache = atoi(value); |
137 | ctx.cfg.nocache = atoi(value); |
136 | else if (!strcmp(name, "noplainemail")) |
138 | else if (!strcmp(name, "noplainemail")) |
137 | ctx.cfg.noplainemail = atoi(value); |
139 | ctx.cfg.noplainemail = atoi(value); |
138 | else if (!strcmp(name, "noheader")) |
140 | else if (!strcmp(name, "noheader")) |
139 | ctx.cfg.noheader = atoi(value); |
141 | ctx.cfg.noheader = atoi(value); |
140 | else if (!strcmp(name, "snapshots")) |
142 | else if (!strcmp(name, "snapshots")) |
141 | ctx.cfg.snapshots = cgit_parse_snapshots_mask(value); |
143 | ctx.cfg.snapshots = cgit_parse_snapshots_mask(value); |
142 | else if (!strcmp(name, "enable-filter-overrides")) |
144 | else if (!strcmp(name, "enable-filter-overrides")) |
143 | ctx.cfg.enable_filter_overrides = atoi(value); |
145 | ctx.cfg.enable_filter_overrides = atoi(value); |
144 | else if (!strcmp(name, "enable-gitweb-owner")) |
146 | else if (!strcmp(name, "enable-gitweb-owner")) |
145 | ctx.cfg.enable_gitweb_owner = atoi(value); |
147 | ctx.cfg.enable_gitweb_owner = atoi(value); |
146 | else if (!strcmp(name, "enable-index-links")) |
148 | else if (!strcmp(name, "enable-index-links")) |
147 | ctx.cfg.enable_index_links = atoi(value); |
149 | ctx.cfg.enable_index_links = atoi(value); |
| |
150 | else if (!strcmp(name, "enable-commit-graph")) |
| |
151 | ctx.cfg.enable_commit_graph = atoi(value); |
148 | else if (!strcmp(name, "enable-log-filecount")) |
152 | else if (!strcmp(name, "enable-log-filecount")) |
149 | ctx.cfg.enable_log_filecount = atoi(value); |
153 | ctx.cfg.enable_log_filecount = atoi(value); |
150 | else if (!strcmp(name, "enable-log-linecount")) |
154 | else if (!strcmp(name, "enable-log-linecount")) |
151 | ctx.cfg.enable_log_linecount = atoi(value); |
155 | ctx.cfg.enable_log_linecount = atoi(value); |
152 | else if (!strcmp(name, "enable-remote-branches")) |
156 | else if (!strcmp(name, "enable-remote-branches")) |
153 | ctx.cfg.enable_remote_branches = atoi(value); |
157 | ctx.cfg.enable_remote_branches = atoi(value); |
154 | else if (!strcmp(name, "enable-subject-links")) |
158 | else if (!strcmp(name, "enable-subject-links")) |
155 | ctx.cfg.enable_subject_links = atoi(value); |
159 | ctx.cfg.enable_subject_links = atoi(value); |
156 | else if (!strcmp(name, "enable-tree-linenumbers")) |
160 | else if (!strcmp(name, "enable-tree-linenumbers")) |
157 | ctx.cfg.enable_tree_linenumbers = atoi(value); |
161 | ctx.cfg.enable_tree_linenumbers = atoi(value); |
158 | else if (!strcmp(name, "max-stats")) |
162 | else if (!strcmp(name, "max-stats")) |
159 | ctx.cfg.max_stats = cgit_find_stats_period(value, NULL); |
163 | ctx.cfg.max_stats = cgit_find_stats_period(value, NULL); |
160 | else if (!strcmp(name, "cache-size")) |
164 | else if (!strcmp(name, "cache-size")) |
161 | ctx.cfg.cache_size = atoi(value); |
165 | ctx.cfg.cache_size = atoi(value); |
162 | else if (!strcmp(name, "cache-root")) |
166 | else if (!strcmp(name, "cache-root")) |
163 | ctx.cfg.cache_root = xstrdup(expand_macros(value)); |
167 | ctx.cfg.cache_root = xstrdup(expand_macros(value)); |
164 | else if (!strcmp(name, "cache-root-ttl")) |
168 | else if (!strcmp(name, "cache-root-ttl")) |
165 | ctx.cfg.cache_root_ttl = atoi(value); |
169 | ctx.cfg.cache_root_ttl = atoi(value); |
166 | else if (!strcmp(name, "cache-repo-ttl")) |
170 | else if (!strcmp(name, "cache-repo-ttl")) |
167 | ctx.cfg.cache_repo_ttl = atoi(value); |
171 | ctx.cfg.cache_repo_ttl = atoi(value); |
168 | else if (!strcmp(name, "cache-scanrc-ttl")) |
172 | else if (!strcmp(name, "cache-scanrc-ttl")) |
169 | ctx.cfg.cache_scanrc_ttl = atoi(value); |
173 | ctx.cfg.cache_scanrc_ttl = atoi(value); |
170 | else if (!strcmp(name, "cache-static-ttl")) |
174 | else if (!strcmp(name, "cache-static-ttl")) |
171 | ctx.cfg.cache_static_ttl = atoi(value); |
175 | ctx.cfg.cache_static_ttl = atoi(value); |
@@ -178,48 +182,50 @@ void config_cb(const char *name, const char *value) |
178 | else if (!strcmp(name, "embedded")) |
182 | else if (!strcmp(name, "embedded")) |
179 | ctx.cfg.embedded = atoi(value); |
183 | ctx.cfg.embedded = atoi(value); |
180 | else if (!strcmp(name, "max-atom-items")) |
184 | else if (!strcmp(name, "max-atom-items")) |
181 | ctx.cfg.max_atom_items = atoi(value); |
185 | ctx.cfg.max_atom_items = atoi(value); |
182 | else if (!strcmp(name, "max-message-length")) |
186 | else if (!strcmp(name, "max-message-length")) |
183 | ctx.cfg.max_msg_len = atoi(value); |
187 | ctx.cfg.max_msg_len = atoi(value); |
184 | else if (!strcmp(name, "max-repodesc-length")) |
188 | else if (!strcmp(name, "max-repodesc-length")) |
185 | ctx.cfg.max_repodesc_len = atoi(value); |
189 | ctx.cfg.max_repodesc_len = atoi(value); |
186 | else if (!strcmp(name, "max-blob-size")) |
190 | else if (!strcmp(name, "max-blob-size")) |
187 | ctx.cfg.max_blob_size = atoi(value); |
191 | ctx.cfg.max_blob_size = atoi(value); |
188 | else if (!strcmp(name, "max-repo-count")) |
192 | else if (!strcmp(name, "max-repo-count")) |
189 | ctx.cfg.max_repo_count = atoi(value); |
193 | ctx.cfg.max_repo_count = atoi(value); |
190 | else if (!strcmp(name, "max-commit-count")) |
194 | else if (!strcmp(name, "max-commit-count")) |
191 | ctx.cfg.max_commit_count = atoi(value); |
195 | ctx.cfg.max_commit_count = atoi(value); |
192 | else if (!strcmp(name, "project-list")) |
196 | else if (!strcmp(name, "project-list")) |
193 | ctx.cfg.project_list = xstrdup(expand_macros(value)); |
197 | ctx.cfg.project_list = xstrdup(expand_macros(value)); |
194 | else if (!strcmp(name, "scan-path")) |
198 | else if (!strcmp(name, "scan-path")) |
195 | if (!ctx.cfg.nocache && ctx.cfg.cache_size) |
199 | if (!ctx.cfg.nocache && ctx.cfg.cache_size) |
196 | process_cached_repolist(expand_macros(value)); |
200 | process_cached_repolist(expand_macros(value)); |
197 | else if (ctx.cfg.project_list) |
201 | else if (ctx.cfg.project_list) |
198 | scan_projects(expand_macros(value), |
202 | scan_projects(expand_macros(value), |
199 | ctx.cfg.project_list, repo_config); |
203 | ctx.cfg.project_list, repo_config); |
200 | else |
204 | else |
201 | scan_tree(expand_macros(value), repo_config); |
205 | scan_tree(expand_macros(value), repo_config); |
| |
206 | else if (!strcmp(name, "scan-hidden-path")) |
| |
207 | ctx.cfg.scan_hidden_path = atoi(value); |
202 | else if (!strcmp(name, "section-from-path")) |
208 | else if (!strcmp(name, "section-from-path")) |
203 | ctx.cfg.section_from_path = atoi(value); |
209 | ctx.cfg.section_from_path = atoi(value); |
204 | else if (!strcmp(name, "source-filter")) |
210 | else if (!strcmp(name, "source-filter")) |
205 | ctx.cfg.source_filter = new_filter(value, 1); |
211 | ctx.cfg.source_filter = new_filter(value, 1); |
206 | else if (!strcmp(name, "summary-log")) |
212 | else if (!strcmp(name, "summary-log")) |
207 | ctx.cfg.summary_log = atoi(value); |
213 | ctx.cfg.summary_log = atoi(value); |
208 | else if (!strcmp(name, "summary-branches")) |
214 | else if (!strcmp(name, "summary-branches")) |
209 | ctx.cfg.summary_branches = atoi(value); |
215 | ctx.cfg.summary_branches = atoi(value); |
210 | else if (!strcmp(name, "summary-tags")) |
216 | else if (!strcmp(name, "summary-tags")) |
211 | ctx.cfg.summary_tags = atoi(value); |
217 | ctx.cfg.summary_tags = atoi(value); |
212 | else if (!strcmp(name, "side-by-side-diffs")) |
218 | else if (!strcmp(name, "side-by-side-diffs")) |
213 | ctx.cfg.ssdiff = atoi(value); |
219 | ctx.cfg.ssdiff = atoi(value); |
214 | else if (!strcmp(name, "agefile")) |
220 | else if (!strcmp(name, "agefile")) |
215 | ctx.cfg.agefile = xstrdup(value); |
221 | ctx.cfg.agefile = xstrdup(value); |
216 | else if (!strcmp(name, "renamelimit")) |
222 | else if (!strcmp(name, "renamelimit")) |
217 | ctx.cfg.renamelimit = atoi(value); |
223 | ctx.cfg.renamelimit = atoi(value); |
218 | else if (!strcmp(name, "remove-suffix")) |
224 | else if (!strcmp(name, "remove-suffix")) |
219 | ctx.cfg.remove_suffix = atoi(value); |
225 | ctx.cfg.remove_suffix = atoi(value); |
220 | else if (!strcmp(name, "robots")) |
226 | else if (!strcmp(name, "robots")) |
221 | ctx.cfg.robots = xstrdup(value); |
227 | ctx.cfg.robots = xstrdup(value); |
222 | else if (!strcmp(name, "clone-prefix")) |
228 | else if (!strcmp(name, "clone-prefix")) |
223 | ctx.cfg.clone_prefix = xstrdup(value); |
229 | ctx.cfg.clone_prefix = xstrdup(value); |
224 | else if (!strcmp(name, "local-time")) |
230 | else if (!strcmp(name, "local-time")) |
225 | ctx.cfg.local_time = atoi(value); |
231 | ctx.cfg.local_time = atoi(value); |
@@ -298,48 +304,49 @@ static void prepare_context(struct cgit_context *ctx) |
298 | ctx->cfg.cache_repo_ttl = 5; |
304 | ctx->cfg.cache_repo_ttl = 5; |
299 | ctx->cfg.cache_root = CGIT_CACHE_ROOT; |
305 | ctx->cfg.cache_root = CGIT_CACHE_ROOT; |
300 | ctx->cfg.cache_root_ttl = 5; |
306 | ctx->cfg.cache_root_ttl = 5; |
301 | ctx->cfg.cache_scanrc_ttl = 15; |
307 | ctx->cfg.cache_scanrc_ttl = 15; |
302 | ctx->cfg.cache_static_ttl = -1; |
308 | ctx->cfg.cache_static_ttl = -1; |
303 | ctx->cfg.css = "/cgit.css"; |
309 | ctx->cfg.css = "/cgit.css"; |
304 | ctx->cfg.logo = "/cgit.png"; |
310 | ctx->cfg.logo = "/cgit.png"; |
305 | ctx->cfg.local_time = 0; |
311 | ctx->cfg.local_time = 0; |
306 | ctx->cfg.enable_gitweb_owner = 1; |
312 | ctx->cfg.enable_gitweb_owner = 1; |
307 | ctx->cfg.enable_tree_linenumbers = 1; |
313 | ctx->cfg.enable_tree_linenumbers = 1; |
308 | ctx->cfg.max_repo_count = 50; |
314 | ctx->cfg.max_repo_count = 50; |
309 | ctx->cfg.max_commit_count = 50; |
315 | ctx->cfg.max_commit_count = 50; |
310 | ctx->cfg.max_lock_attempts = 5; |
316 | ctx->cfg.max_lock_attempts = 5; |
311 | ctx->cfg.max_msg_len = 80; |
317 | ctx->cfg.max_msg_len = 80; |
312 | ctx->cfg.max_repodesc_len = 80; |
318 | ctx->cfg.max_repodesc_len = 80; |
313 | ctx->cfg.max_blob_size = 0; |
319 | ctx->cfg.max_blob_size = 0; |
314 | ctx->cfg.max_stats = 0; |
320 | ctx->cfg.max_stats = 0; |
315 | ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; |
321 | ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; |
316 | ctx->cfg.project_list = NULL; |
322 | ctx->cfg.project_list = NULL; |
317 | ctx->cfg.renamelimit = -1; |
323 | ctx->cfg.renamelimit = -1; |
318 | ctx->cfg.remove_suffix = 0; |
324 | ctx->cfg.remove_suffix = 0; |
319 | ctx->cfg.robots = "index, nofollow"; |
325 | ctx->cfg.robots = "index, nofollow"; |
320 | ctx->cfg.root_title = "Git repository browser"; |
326 | ctx->cfg.root_title = "Git repository browser"; |
321 | ctx->cfg.root_desc = "a fast webinterface for the git dscm"; |
327 | ctx->cfg.root_desc = "a fast webinterface for the git dscm"; |
| |
328 | ctx->cfg.scan_hidden_path = 0; |
322 | ctx->cfg.script_name = CGIT_SCRIPT_NAME; |
329 | ctx->cfg.script_name = CGIT_SCRIPT_NAME; |
323 | ctx->cfg.section = ""; |
330 | ctx->cfg.section = ""; |
324 | ctx->cfg.summary_branches = 10; |
331 | ctx->cfg.summary_branches = 10; |
325 | ctx->cfg.summary_log = 10; |
332 | ctx->cfg.summary_log = 10; |
326 | ctx->cfg.summary_tags = 10; |
333 | ctx->cfg.summary_tags = 10; |
327 | ctx->cfg.max_atom_items = 10; |
334 | ctx->cfg.max_atom_items = 10; |
328 | ctx->cfg.ssdiff = 0; |
335 | ctx->cfg.ssdiff = 0; |
329 | ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); |
336 | ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); |
330 | ctx->env.http_host = xstrdupn(getenv("HTTP_HOST")); |
337 | ctx->env.http_host = xstrdupn(getenv("HTTP_HOST")); |
331 | ctx->env.https = xstrdupn(getenv("HTTPS")); |
338 | ctx->env.https = xstrdupn(getenv("HTTPS")); |
332 | ctx->env.no_http = xstrdupn(getenv("NO_HTTP")); |
339 | ctx->env.no_http = xstrdupn(getenv("NO_HTTP")); |
333 | ctx->env.path_info = xstrdupn(getenv("PATH_INFO")); |
340 | ctx->env.path_info = xstrdupn(getenv("PATH_INFO")); |
334 | ctx->env.query_string = xstrdupn(getenv("QUERY_STRING")); |
341 | ctx->env.query_string = xstrdupn(getenv("QUERY_STRING")); |
335 | ctx->env.request_method = xstrdupn(getenv("REQUEST_METHOD")); |
342 | ctx->env.request_method = xstrdupn(getenv("REQUEST_METHOD")); |
336 | ctx->env.script_name = xstrdupn(getenv("SCRIPT_NAME")); |
343 | ctx->env.script_name = xstrdupn(getenv("SCRIPT_NAME")); |
337 | ctx->env.server_name = xstrdupn(getenv("SERVER_NAME")); |
344 | ctx->env.server_name = xstrdupn(getenv("SERVER_NAME")); |
338 | ctx->env.server_port = xstrdupn(getenv("SERVER_PORT")); |
345 | ctx->env.server_port = xstrdupn(getenv("SERVER_PORT")); |
339 | ctx->page.mimetype = "text/html"; |
346 | ctx->page.mimetype = "text/html"; |
340 | ctx->page.charset = PAGE_ENCODING; |
347 | ctx->page.charset = PAGE_ENCODING; |
341 | ctx->page.filename = NULL; |
348 | ctx->page.filename = NULL; |
342 | ctx->page.size = 0; |
349 | ctx->page.size = 0; |
343 | ctx->page.modified = time(NULL); |
350 | ctx->page.modified = time(NULL); |
344 | ctx->page.expires = ctx->page.modified; |
351 | ctx->page.expires = ctx->page.modified; |
345 | ctx->page.etag = NULL; |
352 | ctx->page.etag = NULL; |
@@ -523,48 +530,50 @@ char *get_first_line(char *txt) |
523 | } |
530 | } |
524 | |
531 | |
525 | void print_repo(FILE *f, struct cgit_repo *repo) |
532 | void print_repo(FILE *f, struct cgit_repo *repo) |
526 | { |
533 | { |
527 | fprintf(f, "repo.url=%s\n", repo->url); |
534 | fprintf(f, "repo.url=%s\n", repo->url); |
528 | fprintf(f, "repo.name=%s\n", repo->name); |
535 | fprintf(f, "repo.name=%s\n", repo->name); |
529 | fprintf(f, "repo.path=%s\n", repo->path); |
536 | fprintf(f, "repo.path=%s\n", repo->path); |
530 | if (repo->owner) |
537 | if (repo->owner) |
531 | fprintf(f, "repo.owner=%s\n", repo->owner); |
538 | fprintf(f, "repo.owner=%s\n", repo->owner); |
532 | if (repo->desc) { |
539 | if (repo->desc) { |
533 | char *tmp = get_first_line(repo->desc); |
540 | char *tmp = get_first_line(repo->desc); |
534 | fprintf(f, "repo.desc=%s\n", tmp); |
541 | fprintf(f, "repo.desc=%s\n", tmp); |
535 | free(tmp); |
542 | free(tmp); |
536 | } |
543 | } |
537 | if (repo->readme) |
544 | if (repo->readme) |
538 | fprintf(f, "repo.readme=%s\n", repo->readme); |
545 | fprintf(f, "repo.readme=%s\n", repo->readme); |
539 | if (repo->defbranch) |
546 | if (repo->defbranch) |
540 | fprintf(f, "repo.defbranch=%s\n", repo->defbranch); |
547 | fprintf(f, "repo.defbranch=%s\n", repo->defbranch); |
541 | if (repo->module_link) |
548 | if (repo->module_link) |
542 | fprintf(f, "repo.module-link=%s\n", repo->module_link); |
549 | fprintf(f, "repo.module-link=%s\n", repo->module_link); |
543 | if (repo->section) |
550 | if (repo->section) |
544 | fprintf(f, "repo.section=%s\n", repo->section); |
551 | fprintf(f, "repo.section=%s\n", repo->section); |
545 | if (repo->clone_url) |
552 | if (repo->clone_url) |
546 | fprintf(f, "repo.clone-url=%s\n", repo->clone_url); |
553 | fprintf(f, "repo.clone-url=%s\n", repo->clone_url); |
| |
554 | fprintf(f, "repo.enable-commit-graph=%d\n", |
| |
555 | repo->enable_commit_graph); |
547 | fprintf(f, "repo.enable-log-filecount=%d\n", |
556 | fprintf(f, "repo.enable-log-filecount=%d\n", |
548 | repo->enable_log_filecount); |
557 | repo->enable_log_filecount); |
549 | fprintf(f, "repo.enable-log-linecount=%d\n", |
558 | fprintf(f, "repo.enable-log-linecount=%d\n", |
550 | repo->enable_log_linecount); |
559 | repo->enable_log_linecount); |
551 | if (repo->about_filter && repo->about_filter != ctx.cfg.about_filter) |
560 | if (repo->about_filter && repo->about_filter != ctx.cfg.about_filter) |
552 | fprintf(f, "repo.about-filter=%s\n", repo->about_filter->cmd); |
561 | fprintf(f, "repo.about-filter=%s\n", repo->about_filter->cmd); |
553 | if (repo->commit_filter && repo->commit_filter != ctx.cfg.commit_filter) |
562 | if (repo->commit_filter && repo->commit_filter != ctx.cfg.commit_filter) |
554 | fprintf(f, "repo.commit-filter=%s\n", repo->commit_filter->cmd); |
563 | fprintf(f, "repo.commit-filter=%s\n", repo->commit_filter->cmd); |
555 | if (repo->source_filter && repo->source_filter != ctx.cfg.source_filter) |
564 | if (repo->source_filter && repo->source_filter != ctx.cfg.source_filter) |
556 | fprintf(f, "repo.source-filter=%s\n", repo->source_filter->cmd); |
565 | fprintf(f, "repo.source-filter=%s\n", repo->source_filter->cmd); |
557 | if (repo->snapshots != ctx.cfg.snapshots) { |
566 | if (repo->snapshots != ctx.cfg.snapshots) { |
558 | char *tmp = build_snapshot_setting(repo->snapshots); |
567 | char *tmp = build_snapshot_setting(repo->snapshots); |
559 | fprintf(f, "repo.snapshots=%s\n", tmp); |
568 | fprintf(f, "repo.snapshots=%s\n", tmp); |
560 | free(tmp); |
569 | free(tmp); |
561 | } |
570 | } |
562 | if (repo->max_stats != ctx.cfg.max_stats) |
571 | if (repo->max_stats != ctx.cfg.max_stats) |
563 | fprintf(f, "repo.max-stats=%s\n", |
572 | fprintf(f, "repo.max-stats=%s\n", |
564 | cgit_find_stats_periodname(repo->max_stats)); |
573 | cgit_find_stats_periodname(repo->max_stats)); |
565 | fprintf(f, "\n"); |
574 | fprintf(f, "\n"); |
566 | } |
575 | } |
567 | |
576 | |
568 | void print_repolist(FILE *f, struct cgit_repolist *list, int start) |
577 | void print_repolist(FILE *f, struct cgit_repolist *list, int start) |
569 | { |
578 | { |
570 | int i; |
579 | int i; |
|