diff options
author | Tobias Bieniek | 2012-10-13 16:10:30 +0200 |
---|---|---|
committer | Jason A. Donenfeld | 2012-10-17 16:30:29 +0200 |
commit | 792f813d342013124ce40142fef4afee3ff00df3 (patch) | |
tree | 9d42fff81b16cba44c8c765f2866cc79ddb507cd /ui-log.c | |
parent | 7a4e7c8ffbacfad5ac83ad20426d7911c2eacdeb (diff) | |
download | cgit-792f813d342013124ce40142fef4afee3ff00df3.tar.gz cgit-792f813d342013124ce40142fef4afee3ff00df3.tar.bz2 cgit-792f813d342013124ce40142fef4afee3ff00df3.zip |
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 'ui-log.c')
-rw-r--r-- | ui-log.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -278,7 +278,7 @@ static char *next_token(char **src) | |||
278 | } | 278 | } |
279 | 279 | ||
280 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, | 280 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, |
281 | char *path, int pager, int commit_graph) | 281 | char *path, int pager, int commit_graph, int commit_sort) |
282 | { | 282 | { |
283 | struct rev_info rev; | 283 | struct rev_info rev; |
284 | struct commit *commit; | 284 | struct commit *commit; |
@@ -327,6 +327,14 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
327 | COLUMN_COLORS_HTML_MAX); | 327 | COLUMN_COLORS_HTML_MAX); |
328 | } | 328 | } |
329 | 329 | ||
330 | if (commit_sort == 1) { | ||
331 | static const char *date_order_arg = "--date-order"; | ||
332 | vector_push(&vec, &date_order_arg, 0); | ||
333 | } else if (commit_sort == 2) { | ||
334 | static const char *topo_order_arg = "--topo-order"; | ||
335 | vector_push(&vec, &topo_order_arg, 0); | ||
336 | } | ||
337 | |||
330 | if (path) { | 338 | if (path) { |
331 | arg = "--"; | 339 | arg = "--"; |
332 | vector_push(&vec, &arg, 0); | 340 | vector_push(&vec, &arg, 0); |