mirror of
https://git.zx2c4.com/cgit
synced 2024-11-26 10:28:42 +00:00
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>
This commit is contained in:
parent
1830271c59
commit
ddfaef6bb2
2
cgit.h
2
cgit.h
@ -53,7 +53,7 @@ typedef void (*filepair_fn)(struct diff_filepair *pair);
|
|||||||
typedef void (*linediff_fn)(char *line, int len);
|
typedef void (*linediff_fn)(char *line, int len);
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DIFF_UNIFIED, DIFF_SSDIFF
|
DIFF_UNIFIED, DIFF_SSDIFF, DIFF_STATONLY
|
||||||
} diff_type;
|
} diff_type;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -349,6 +349,7 @@ void cgit_print_diff_ctrls()
|
|||||||
curr = ctx.qry.has_difftype ? ctx.qry.difftype : ctx.cfg.difftype;
|
curr = ctx.qry.has_difftype ? ctx.qry.difftype : ctx.cfg.difftype;
|
||||||
html_intoption(0, "unified", curr);
|
html_intoption(0, "unified", curr);
|
||||||
html_intoption(1, "ssdiff", curr);
|
html_intoption(1, "ssdiff", curr);
|
||||||
|
html_intoption(2, "stat only", curr);
|
||||||
html("</select></td></tr>");
|
html("</select></td></tr>");
|
||||||
html("<tr><td/><td class='ctrl'>");
|
html("<tr><td/><td class='ctrl'>");
|
||||||
html("<noscript><input type='submit' value='reload'/></noscript>");
|
html("<noscript><input type='submit' value='reload'/></noscript>");
|
||||||
@ -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);
|
cgit_print_diffstat(old_rev_sha1, new_rev_sha1, prefix);
|
||||||
|
|
||||||
|
if (difftype == DIFF_STATONLY)
|
||||||
|
return;
|
||||||
|
|
||||||
if (use_ssdiff) {
|
if (use_ssdiff) {
|
||||||
html("<table summary='ssdiff' class='ssdiff'>");
|
html("<table summary='ssdiff' class='ssdiff'>");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user