From ddfaef6bb28e697491b25bff5a7b260d44ce6ccf Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sun, 5 Oct 2014 10:59:05 +0100 Subject: ui-diff: add "stat only" diff type This prints the diffstat but stops before printing (or generating) any of the body of the diff. No cgitrc option is added here so that we can wait to see how useful this is before letting people set it as the default. Suggested-by: Konstantin Ryabitsev Signed-off-by: John Keeping --- ui-diff.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ui-diff.c') diff --git a/ui-diff.c b/ui-diff.c index a4ade4d..bf2ec57 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -349,6 +349,7 @@ void cgit_print_diff_ctrls() curr = ctx.qry.has_difftype ? ctx.qry.difftype : ctx.cfg.difftype; html_intoption(0, "unified", curr); html_intoption(1, "ssdiff", curr); + html_intoption(2, "stat only", curr); html(""); html(""); html(""); @@ -429,6 +430,9 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, cgit_print_diffstat(old_rev_sha1, new_rev_sha1, prefix); + if (difftype == DIFF_STATONLY) + return; + if (use_ssdiff) { html(""); } else { -- cgit v1.2.3-70-g09d2