repo->enable_remote_branches = atoi(value);
else if (!strcmp(name, "enable-subject-links"))
repo->enable_subject_links = atoi(value);
- else if (!strcmp(name, "max-stats"))
+ else if (!strcmp(name, "commit-sort")) {
+ if (!strcmp(value, "date"))
+ repo->commit_sort = 1;
+ if (!strcmp(value, "topo"))
+ repo->commit_sort = 2;
+ } else if (!strcmp(name, "max-stats"))
repo->max_stats = cgit_find_stats_period(value, NULL);
else if (!strcmp(name, "module-link"))
repo->module_link= xstrdup(value);
ctx.cfg.clone_url = xstrdup(value);
else if (!strcmp(name, "local-time"))
ctx.cfg.local_time = atoi(value);
- else if (!prefixcmp(name, "mimetype."))
+ else if (!strcmp(name, "commit-sort")) {
+ if (!strcmp(value, "date"))
+ ctx.cfg.commit_sort = 1;
+ if (!strcmp(value, "topo"))
+ ctx.cfg.commit_sort = 2;
+ } else if (!prefixcmp(name, "mimetype."))
add_mimetype(name + 9, value);
else if (!strcmp(name, "include"))
parse_configfile(expand_macros(value), config_cb);
int enable_remote_branches;
int enable_subject_links;
int max_stats;
+ int commit_sort;
time_t mtime;
struct cgit_filter *about_filter;
struct cgit_filter *commit_filter;
int summary_log;
int summary_tags;
int ssdiff;
+ int commit_sort;
struct string_list mimetypes;
struct cgit_filter *about_filter;
struct cgit_filter *commit_filter;
Flag which, if set to "1", makes cgit print commit and tag times in the
servers timezone. Default value: "0".
+commit-sort::
+ Flag which, when set to "date", enables strict date ordering in the
+ commit log, and when set to "topo" enables strict topological
+ ordering. If unset, the default ordering of "git log" is used. Default
+ value: unset.
+
logo::
Url which specifies the source of an image which will be used as a logo
on all cgit pages. Default value: "/cgit.png".
A flag which can be used to override the global setting
`enable-subject-links'. Default value: none.
+repo.commit-sort::
+ Flag which, when set to "date", enables strict date ordering in the
+ commit log, and when set to "topo" enables strict topological
+ ordering. If unset, the default ordering of "git log" is used. Default
+ value: unset.
+
repo.logo::
Url which specifies the source of an image which will be used as a logo
on this repo's pages. Default value: global logo.
{
cgit_print_log(ctx->qry.sha1, ctx->qry.ofs, ctx->cfg.max_commit_count,
ctx->qry.grep, ctx->qry.search, ctx->qry.path, 1,
- ctx->repo->enable_commit_graph);
+ ctx->repo->enable_commit_graph,
+ ctx->repo->commit_sort);
}
static void ls_cache_fn(struct cgit_context *ctx)
ret->enable_remote_branches = ctx.cfg.enable_remote_branches;
ret->enable_subject_links = ctx.cfg.enable_subject_links;
ret->max_stats = ctx.cfg.max_stats;
+ ret->commit_sort = ctx.cfg.commit_sort;
ret->module_link = ctx.cfg.module_link;
ret->readme = ctx.cfg.readme;
ret->mtime = -1;
}
void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern,
- char *path, int pager, int commit_graph)
+ char *path, int pager, int commit_graph, int commit_sort)
{
struct rev_info rev;
struct commit *commit;
COLUMN_COLORS_HTML_MAX);
}
+ if (commit_sort == 1) {
+ static const char *date_order_arg = "--date-order";
+ vector_push(&vec, &date_order_arg, 0);
+ } else if (commit_sort == 2) {
+ static const char *topo_order_arg = "--topo-order";
+ vector_push(&vec, &topo_order_arg, 0);
+ }
+
if (path) {
arg = "--";
vector_push(&vec, &arg, 0);
extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep,
char *pattern, char *path, int pager,
- int commit_graph);
+ int commit_graph, int commit_sort);
extern void show_commit_decorations(struct commit *commit);
#endif /* UI_LOG_H */
if (ctx.cfg.summary_log > 0) {
html("<tr class='nohover'><td colspan='4'> </td></tr>");
cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL,
- NULL, NULL, 0, 0);
+ NULL, NULL, 0, 0, 0);
}
if (ctx.repo->clone_url)
print_urls(expand_macros(ctx.repo->clone_url), NULL);