summaryrefslogtreecommitdiff
path: root/ui-log.c
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2014-03-22 18:05:42 -0700
committerKent Overstreet <kmo@daterainc.com>2014-03-22 18:05:42 -0700
commit03de8b68f17396d7710d2584c6a6fc786c26279f (patch)
tree4c2b9125786e3ca99f7d208d62eeca1fdf4abb97 /ui-log.c
parent88b93113235452d47e7ce474689327c43e64b843 (diff)
Add support for log output minus another branchHEADmaster
This lets you do the equivalent of git log ^ref1 ref2 by adding an id2 parameter to a log url
Diffstat (limited to 'ui-log.c')
-rw-r--r--ui-log.c14
1 files changed, 11 insertions, 3 deletions
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);
}