author | Lars Hjemli <hjemli@gmail.com> | 2006-12-28 01:45:28 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2006-12-28 01:45:28 (UTC) |
commit | 732d68d240b95dc428c92fc94bce9adb8912094e (patch) (unidiff) | |
tree | 24c6ab907c2a8574da12e426144706ad63780868 /cgit.c | |
parent | e39d738c39d37cdef115c145027f3eec85a62272 (diff) | |
download | cgit-732d68d240b95dc428c92fc94bce9adb8912094e.zip cgit-732d68d240b95dc428c92fc94bce9adb8912094e.tar.gz cgit-732d68d240b95dc428c92fc94bce9adb8912094e.tar.bz2 |
Add basic log filtering
This enables case-insensitive grep on logentris using the new search box
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -19,22 +19,25 @@ static void cgit_print_repo_page(struct cacheitem *item) | |||
19 | cgit_print_pageheader(title, 0); | 19 | cgit_print_pageheader(title, 0); |
20 | cgit_print_error(fmt("Unable to scan repository: %s", | 20 | cgit_print_error(fmt("Unable to scan repository: %s", |
21 | strerror(errno))); | 21 | strerror(errno))); |
22 | cgit_print_docend(); | 22 | cgit_print_docend(); |
23 | return; | 23 | return; |
24 | } | 24 | } |
25 | setenv("GIT_DIR", fmt("%s/%s", cgit_root, cgit_query_repo), 1); | 25 | setenv("GIT_DIR", fmt("%s/%s", cgit_root, cgit_query_repo), 1); |
26 | char *title = fmt("%s - %s", cgit_repo_name, cgit_repo_desc); | 26 | char *title = fmt("%s - %s", cgit_repo_name, cgit_repo_desc); |
27 | int show_search = 0; | ||
28 | if (cgit_query_page && !strcmp(cgit_query_page, "log")) | ||
29 | show_search = 1; | ||
27 | cgit_print_docstart(title, item); | 30 | cgit_print_docstart(title, item); |
28 | cgit_print_pageheader(title, 0); | 31 | cgit_print_pageheader(title, show_search); |
29 | if (!cgit_query_page) { | 32 | if (!cgit_query_page) { |
30 | cgit_print_summary(); | 33 | cgit_print_summary(); |
31 | } else if (!strcmp(cgit_query_page, "log")) { | 34 | } else if (!strcmp(cgit_query_page, "log")) { |
32 | cgit_print_log(cgit_query_head, cgit_query_ofs, 100); | 35 | cgit_print_log(cgit_query_head, cgit_query_ofs, 100, cgit_query_search); |
33 | } else if (!strcmp(cgit_query_page, "tree")) { | 36 | } else if (!strcmp(cgit_query_page, "tree")) { |
34 | cgit_print_tree(cgit_query_sha1); | 37 | cgit_print_tree(cgit_query_sha1); |
35 | } else if (!strcmp(cgit_query_page, "commit")) { | 38 | } else if (!strcmp(cgit_query_page, "commit")) { |
36 | cgit_print_commit(cgit_query_sha1); | 39 | cgit_print_commit(cgit_query_sha1); |
37 | } else if (!strcmp(cgit_query_page, "view")) { | 40 | } else if (!strcmp(cgit_query_page, "view")) { |
38 | cgit_print_view(cgit_query_sha1); | 41 | cgit_print_view(cgit_query_sha1); |
39 | } else if (!strcmp(cgit_query_page, "diff")) { | 42 | } else if (!strcmp(cgit_query_page, "diff")) { |
40 | cgit_print_diff(cgit_query_sha1, cgit_query_sha2); | 43 | cgit_print_diff(cgit_query_sha1, cgit_query_sha2); |