summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd.c6
-rw-r--r--ui-log.c14
-rw-r--r--ui-log.h4
-rw-r--r--ui-summary.c2
4 files changed, 17 insertions, 9 deletions
diff --git a/cmd.c b/cmd.c
index 188cd56..253cbc3 100644
--- a/cmd.c
+++ b/cmd.c
@@ -71,9 +71,9 @@ static void info_fn(void)
static void log_fn(void)
{
- cgit_print_log(ctx.qry.sha1, ctx.qry.ofs, ctx.cfg.max_commit_count,
- ctx.qry.grep, ctx.qry.search, ctx.qry.path, 1,
- ctx.repo->enable_commit_graph,
+ cgit_print_log(ctx.qry.sha1, ctx.qry.sha2, ctx.qry.ofs,
+ ctx.cfg.max_commit_count, ctx.qry.grep, ctx.qry.search,
+ ctx.qry.path, 1, ctx.repo->enable_commit_graph,
ctx.repo->commit_sort);
}
diff --git a/ui-log.c b/ui-log.c
index 499534c..824da02 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -285,18 +285,24 @@ static char *next_token(char **src)
return result;
}
-void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern,
- char *path, int pager, int commit_graph, int commit_sort)
+void cgit_print_log(const char *tip, const char *from, int ofs, int cnt,
+ char *grep, char *pattern, char *path, int pager,
+ int commit_graph, int commit_sort)
{
struct rev_info rev;
struct commit *commit;
struct argv_array rev_argv = ARGV_ARRAY_INIT;
int i, columns = commit_graph ? 4 : 3;
- int must_free_tip = 0;
+ int must_free_tip = 0, must_free_from = 0;
/* rev_argv.argv[0] will be ignored by setup_revisions */
argv_array_push(&rev_argv, "log_rev_setup");
+ if (from) {
+ from = disambiguate_ref(from, &must_free_from);
+ argv_array_pushf(&rev_argv, "^%s", from);
+ }
+
if (!tip)
tip = ctx.qry.head;
tip = disambiguate_ref(tip, &must_free_tip);
@@ -430,4 +436,6 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
/* If we allocated tip then it is safe to cast away const. */
if (must_free_tip)
free((char*) tip);
+ if (must_free_from)
+ free((char*) from);
}
diff --git a/ui-log.h b/ui-log.h
index d324c92..7f55044 100644
--- a/ui-log.h
+++ b/ui-log.h
@@ -1,8 +1,8 @@
#ifndef UI_LOG_H
#define UI_LOG_H
-extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep,
- char *pattern, char *path, int pager,
+extern void cgit_print_log(const char *tip, const char *from, int ofs, int cnt,
+ char *grep, char *pattern, char *path, int pager,
int commit_graph, int commit_sort);
extern void show_commit_decorations(struct commit *commit);
diff --git a/ui-summary.c b/ui-summary.c
index ddd8f1b..2c41cff 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -85,7 +85,7 @@ void cgit_print_summary()
cgit_print_tags(ctx.cfg.summary_tags);
if (ctx.cfg.summary_log > 0) {
htmlf("<tr class='nohover'><td colspan='%d'>&nbsp;</td></tr>", columns);
- cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL,
+ cgit_print_log(ctx.qry.head, NULL, 0, ctx.cfg.summary_log, NULL,
NULL, NULL, 0, 0, 0);
}
if (ctx.repo->clone_url)