diff options
author | Lars Hjemli <hjemli@gmail.com> | 2006-12-28 02:45:28 +0100 |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2006-12-28 02:45:28 +0100 |
commit | 732d68d240b95dc428c92fc94bce9adb8912094e (patch) | |
tree | 24c6ab907c2a8574da12e426144706ad63780868 /ui-log.c | |
parent | e39d738c39d37cdef115c145027f3eec85a62272 (diff) |
Add basic log filtering
This enables case-insensitive grep on logentris using the new search box
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | ui-log.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -32,19 +32,26 @@ void print_commit(struct commit *commit) } -void cgit_print_log(const char *tip, int ofs, int cnt) +void cgit_print_log(const char *tip, int ofs, int cnt, char *grep) { struct rev_info rev; struct commit *commit; - const char *argv[2] = {NULL, tip}; + const char *argv[3] = {NULL, tip, NULL}; + int argc = 2; int i; + if (grep) + argv[argc++] = fmt("--grep=%s", grep); init_revisions(&rev, NULL); rev.abbrev = DEFAULT_ABBREV; rev.commit_format = CMIT_FMT_DEFAULT; rev.verbose_header = 1; rev.show_root_diff = 0; - setup_revisions(2, argv, &rev, NULL); + setup_revisions(argc, argv, &rev, NULL); + if (rev.grep_filter) { + rev.grep_filter->regflags |= REG_ICASE; + compile_grep_patterns(rev.grep_filter); + } prepare_revision_walk(&rev); html("<h2>Log</h2>"); |