From a579fb02561c98a146c9e707d098d2b10aa02015 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sat, 19 Jun 2010 14:32:37 +0200 Subject: ui-log.c: allow commit range as search expression Inspired-by: Johan Herland Signed-off-by: Lars Hjemli --- ui-log.c | 11 +++++++---- ui-shared.c | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ui-log.c b/ui-log.c index 0947604..4441d1d 100644 --- a/ui-log.c +++ b/ui-log.c @@ -146,10 +146,13 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern argv[1] = disambiguate_ref(tip); - if (grep && pattern && (!strcmp(grep, "grep") || - !strcmp(grep, "author") || - !strcmp(grep, "committer"))) - argv[argc++] = fmt("--%s=%s", grep, pattern); + if (grep && pattern) { + if (!strcmp(grep, "grep") || !strcmp(grep, "author") || + !strcmp(grep, "committer")) + argv[argc++] = fmt("--%s=%s", grep, pattern); + if (!strcmp(grep, "range")) + argv[1] = pattern; + } if (path) { argv[argc++] = "--"; diff --git a/ui-shared.c b/ui-shared.c index 8827fff..0f65474 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -738,6 +738,7 @@ void cgit_print_pageheader(struct cgit_context *ctx) html_option("grep", "log msg", ctx->qry.grep); html_option("author", "author", ctx->qry.grep); html_option("committer", "committer", ctx->qry.grep); + html_option("range", "range", ctx->qry.grep); html("\n"); html("