From c358aa3dfebf4fc1f3005dd960aa5c1c020eed76 Mon Sep 17 00:00:00 2001 From: Ragnar Ouchterlony Date: Mon, 14 Sep 2009 20:19:02 +0200 Subject: Add possibility to switch between unidiff and side-by-side-diff. A new config option side-by-side-diffs added, defaulting to 0, meaning unidiff. Also a query option (ss) is used toggle this. In the commit page you can switch between the two diff formats by clicking on the link on the "commit"-row, to the right of (patch). In the diff page you can switch by using the link at the start of the page. All commit-links and diff-links will remember the choice. Signed-off-by: Ragnar Ouchterlony Signed-off-by: Lars Hjemli --- cgit.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cgit.c') diff --git a/cgit.c b/cgit.c index bd37788..ff678fb 100644 --- a/cgit.c +++ b/cgit.c @@ -182,6 +182,8 @@ void config_cb(const char *name, const char *value) ctx.cfg.summary_branches = atoi(value); else if (!strcmp(name, "summary-tags")) ctx.cfg.summary_tags = atoi(value); + else if (!strcmp(name, "side-by-side-diffs")) + ctx.cfg.ssdiff = atoi(value); else if (!strcmp(name, "agefile")) ctx.cfg.agefile = xstrdup(value); else if (!strcmp(name, "renamelimit")) @@ -238,6 +240,8 @@ static void querystring_cb(const char *name, const char *value) ctx.qry.showmsg = atoi(value); } else if (!strcmp(name, "period")) { ctx.qry.period = xstrdup(value); + } else if (!strcmp(name, "ss")) { + ctx.qry.ssdiff = atoi(value); } } @@ -279,6 +283,7 @@ static void prepare_context(struct cgit_context *ctx) ctx->cfg.summary_branches = 10; ctx->cfg.summary_log = 10; ctx->cfg.summary_tags = 10; + ctx->cfg.ssdiff = 0; ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); ctx->env.http_host = xstrdupn(getenv("HTTP_HOST")); ctx->env.https = xstrdupn(getenv("HTTPS")); -- cgit v1.2.3-59-g8ed1b