diff options
Diffstat (limited to 'ui-log.c')
-rw-r--r-- | ui-log.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -32,19 +32,26 @@ void print_commit(struct commit *commit) | |||
32 | } | 32 | } |
33 | 33 | ||
34 | 34 | ||
35 | void cgit_print_log(const char *tip, int ofs, int cnt) | 35 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep) |
36 | { | 36 | { |
37 | struct rev_info rev; | 37 | struct rev_info rev; |
38 | struct commit *commit; | 38 | struct commit *commit; |
39 | const char *argv[2] = {NULL, tip}; | 39 | const char *argv[3] = {NULL, tip, NULL}; |
40 | int argc = 2; | ||
40 | int i; | 41 | int i; |
41 | 42 | ||
43 | if (grep) | ||
44 | argv[argc++] = fmt("--grep=%s", grep); | ||
42 | init_revisions(&rev, NULL); | 45 | init_revisions(&rev, NULL); |
43 | rev.abbrev = DEFAULT_ABBREV; | 46 | rev.abbrev = DEFAULT_ABBREV; |
44 | rev.commit_format = CMIT_FMT_DEFAULT; | 47 | rev.commit_format = CMIT_FMT_DEFAULT; |
45 | rev.verbose_header = 1; | 48 | rev.verbose_header = 1; |
46 | rev.show_root_diff = 0; | 49 | rev.show_root_diff = 0; |
47 | setup_revisions(2, argv, &rev, NULL); | 50 | setup_revisions(argc, argv, &rev, NULL); |
51 | if (rev.grep_filter) { | ||
52 | rev.grep_filter->regflags |= REG_ICASE; | ||
53 | compile_grep_patterns(rev.grep_filter); | ||
54 | } | ||
48 | prepare_revision_walk(&rev); | 55 | prepare_revision_walk(&rev); |
49 | 56 | ||
50 | html("<h2>Log</h2>"); | 57 | html("<h2>Log</h2>"); |