projects
/
forks
/
stagit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
914880f
)
optimization: suppress large diffs
author
Hiltjo Posthuma
<hiltjo@codemadness.org>
Sat, 30 Apr 2016 10:00:33 +0000
(12:00 +0200)
committer
Hiltjo Posthuma
<hiltjo@codemadness.org>
Sat, 30 Apr 2016 10:47:06 +0000
(12:47 +0200)
the values are arbitrary, these can be tweaked later if needed.
stagit.c
patch
|
blob
|
history
diff --git
a/stagit.c
b/stagit.c
index aea474718c567af173d5ad654826f64e29007e16..4664fdc953f71779b18376c9f84596bd0da4f236 100644
(file)
--- 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("<b>Diffstat:</b>\n<table>", fp);
for (i = 0; i < ci->ndeltas; i++) {