aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.c
diff options
context:
space:
mode:
authorGravatar Tobias Bieniek <Tobias.Bieniek@gmx.de>2012-10-13 23:10:30 (JST)
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com>2012-10-17 23:30:29 (JST)
commit792f813d342013124ce40142fef4afee3ff00df3 (patch)
tree9d42fff81b16cba44c8c765f2866cc79ddb507cd /cgit.c
parent7a4e7c8ffbacfad5ac83ad20426d7911c2eacdeb (diff)
downloadcgit-792f813d342013124ce40142fef4afee3ff00df3.zip
cgit-792f813d342013124ce40142fef4afee3ff00df3.tar.gz
ui-log: Add "commit-sort" option for controlling commit ordering
This makes it possible to use strict commit date ordering or strict topological ordering by passing the corresponding flags to "git log". Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index 35f0da1..a97ed69 100644
--- a/cgit.c
+++ b/cgit.c
@@ -84,7 +84,12 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
84 repo->enable_remote_branches = atoi(value); 84 repo->enable_remote_branches = atoi(value);
85 else if (!strcmp(name, "enable-subject-links")) 85 else if (!strcmp(name, "enable-subject-links"))
86 repo->enable_subject_links = atoi(value); 86 repo->enable_subject_links = atoi(value);
87 else if (!strcmp(name, "max-stats")) 87 else if (!strcmp(name, "commit-sort")) {
88 if (!strcmp(value, "date"))
89 repo->commit_sort = 1;
90 if (!strcmp(value, "topo"))
91 repo->commit_sort = 2;
92 } else if (!strcmp(name, "max-stats"))
88 repo->max_stats = cgit_find_stats_period(value, NULL); 93 repo->max_stats = cgit_find_stats_period(value, NULL);
89 else if (!strcmp(name, "module-link")) 94 else if (!strcmp(name, "module-link"))
90 repo->module_link= xstrdup(value); 95 repo->module_link= xstrdup(value);
@@ -261,7 +266,12 @@ void config_cb(const char *name, const char *value)
261 ctx.cfg.clone_url = xstrdup(value); 266 ctx.cfg.clone_url = xstrdup(value);
262 else if (!strcmp(name, "local-time")) 267 else if (!strcmp(name, "local-time"))
263 ctx.cfg.local_time = atoi(value); 268 ctx.cfg.local_time = atoi(value);
264 else if (!prefixcmp(name, "mimetype.")) 269 else if (!strcmp(name, "commit-sort")) {
270 if (!strcmp(value, "date"))
271 ctx.cfg.commit_sort = 1;
272 if (!strcmp(value, "topo"))
273 ctx.cfg.commit_sort = 2;
274 } else if (!prefixcmp(name, "mimetype."))
265 add_mimetype(name + 9, value); 275 add_mimetype(name + 9, value);
266 else if (!strcmp(name, "include")) 276 else if (!strcmp(name, "include"))
267 parse_configfile(expand_macros(value), config_cb); 277 parse_configfile(expand_macros(value), config_cb);