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 <mricon@kernel.org> Signed-off-by: John Keeping <john@keeping.me.uk>
John Keeping john@keeping.me.uk
Sun, 05 Oct 2014 10:59:05 +0100
M
ui-diff.c
→
ui-diff.c
@@ -349,6 +349,7 @@ html("<select name='dt' onchange='this.form.submit();'>");
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("</select></td></tr>"); html("<tr><td/><td class='ctrl'>"); html("<noscript><input type='submit' value='reload'/></noscript>");@@ -428,6 +429,9 @@ if (show_ctrls)
cgit_print_diff_ctrls(); cgit_print_diffstat(old_rev_sha1, new_rev_sha1, prefix); + + if (difftype == DIFF_STATONLY) + return; if (use_ssdiff) { html("<table summary='ssdiff' class='ssdiff'>");