From: Hiltjo Posthuma Date: Sat, 30 Apr 2016 10:00:33 +0000 (+0200) Subject: optimization: suppress large diffs X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=7067223104f028ba85deaa1996c892ddfb8230dd;p=forks%2Fstagit.git optimization: suppress large diffs the values are arbitrary, these can be tweaked later if needed. --- diff --git a/stagit.c b/stagit.c index aea4747..4664fdc 100644 --- a/stagit.c +++ b/stagit.c @@ -432,6 +432,14 @@ printshowfile(FILE *fp, struct commitinfo *ci) if (!ci->deltas) return; + if (ci->filecount > 1000 || + ci->ndeltas > 1000 || + ci->addcount > 100000 || + ci->delcount > 100000) { + fprintf(fp, "(diff is too large, output suppressed)"); + return; + } + /* diff stat */ fputs("Diffstat:\n", fp); for (i = 0; i < ci->ndeltas; i++) {