aboutsummaryrefslogtreecommitdiffstats
path: root/ui-log.c
diff options
context:
space:
mode:
authorLars Hjemli2007-05-14 11:10:59 +0200
committerLars Hjemli2007-05-14 11:13:18 +0200
commit9fb53af215639fcd3bfb876fa9c8bac221244bdf (patch)
tree3ebbebebed59b53066e16720a32e1b34c54dc609 /ui-log.c
parent4fdf571c888fd38ae362684c429a3bdf24240ef7 (diff)
downloadcgit-9fb53af215639fcd3bfb876fa9c8bac221244bdf.tar.gz
cgit-9fb53af215639fcd3bfb876fa9c8bac221244bdf.tar.bz2
cgit-9fb53af215639fcd3bfb876fa9c8bac221244bdf.zip
Add log filtering by path and link to it from tree view
This enables path-filtering in log-view, and adds a link per entry in tree-view to show the log for each file/directory. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-log.c')
-rw-r--r--ui-log.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui-log.c b/ui-log.c
index 7d1985e..6d5509b 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -53,16 +53,20 @@ void print_commit(struct commit *commit)
53} 53}
54 54
55 55
56void cgit_print_log(const char *tip, int ofs, int cnt, char *grep) 56void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path)
57{ 57{
58 struct rev_info rev; 58 struct rev_info rev;
59 struct commit *commit; 59 struct commit *commit;
60 const char *argv[3] = {NULL, tip, NULL}; 60 const char *argv[] = {NULL, tip, NULL, NULL, NULL};
61 int argc = 2; 61 int argc = 2;
62 int i; 62 int i;
63 63
64 if (grep) 64 if (grep)
65 argv[argc++] = fmt("--grep=%s", grep); 65 argv[argc++] = fmt("--grep=%s", grep);
66 if (path) {
67 argv[argc++] = "--";
68 argv[argc++] = path;
69 }
66 init_revisions(&rev, NULL); 70 init_revisions(&rev, NULL);
67 rev.abbrev = DEFAULT_ABBREV; 71 rev.abbrev = DEFAULT_ABBREV;
68 rev.commit_format = CMIT_FMT_DEFAULT; 72 rev.commit_format = CMIT_FMT_DEFAULT;