diff options
author | John Keeping | 2014-10-05 10:59:05 +0100 |
---|---|---|
committer | Lukas Fleischer | 2014-12-13 12:38:42 +0100 |
commit | ddfaef6bb28e697491b25bff5a7b260d44ce6ccf (patch) | |
tree | 53a8bfe75e9f8250131fb2b38a346731ba5581cd /ui-diff.c | |
parent | 1830271c5958526425f92ae2b369646b54e3c370 (diff) | |
download | cgit-ddfaef6bb28e697491b25bff5a7b260d44ce6ccf.tar.gz cgit-ddfaef6bb28e697491b25bff5a7b260d44ce6ccf.tar.bz2 cgit-ddfaef6bb28e697491b25bff5a7b260d44ce6ccf.zip |
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>
Diffstat (limited to 'ui-diff.c')
-rw-r--r-- | ui-diff.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -349,6 +349,7 @@ void cgit_print_diff_ctrls() | |||
349 | curr = ctx.qry.has_difftype ? ctx.qry.difftype : ctx.cfg.difftype; | 349 | curr = ctx.qry.has_difftype ? ctx.qry.difftype : ctx.cfg.difftype; |
350 | html_intoption(0, "unified", curr); | 350 | html_intoption(0, "unified", curr); |
351 | html_intoption(1, "ssdiff", curr); | 351 | html_intoption(1, "ssdiff", curr); |
352 | html_intoption(2, "stat only", curr); | ||
352 | html("</select></td></tr>"); | 353 | html("</select></td></tr>"); |
353 | html("<tr><td/><td class='ctrl'>"); | 354 | html("<tr><td/><td class='ctrl'>"); |
354 | html("<noscript><input type='submit' value='reload'/></noscript>"); | 355 | html("<noscript><input type='submit' value='reload'/></noscript>"); |
@@ -429,6 +430,9 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, | |||
429 | 430 | ||
430 | cgit_print_diffstat(old_rev_sha1, new_rev_sha1, prefix); | 431 | cgit_print_diffstat(old_rev_sha1, new_rev_sha1, prefix); |
431 | 432 | ||
433 | if (difftype == DIFF_STATONLY) | ||
434 | return; | ||
435 | |||
432 | if (use_ssdiff) { | 436 | if (use_ssdiff) { |
433 | html("<table summary='ssdiff' class='ssdiff'>"); | 437 | html("<table summary='ssdiff' class='ssdiff'>"); |
434 | } else { | 438 | } else { |