1791: Hide unreasonably large diffs.

josh.h*******@gmai***** (Google Code) (Is this you? Claim this profile.)
March 21, 2011
http://reviews.reviewboard.org/


What version are you running?
1.5 RC 1

What's the URL of the page this enhancement relates to, if any?
The diff viewer.

Describe the enhancement and the motivation for it.
We have various tools that generate source code; sometimes these generated files are huge.  Sometimes developers submit diffs of those generated files for code review.  Sometimes those diffs are small enough that they actually get published (i.e. post-review doesn't time out) but still large enough to be virtually meaningless to a reviewer.  We've added a very small change to diffviewer/forms.py (see below) to hide these changes.

What operating system are you using? What browser?
N/A

Please provide any additional information below.
We've modified diffviewer/forms.py as follows, starting at line 155:

    # treat gigantic diffs as binary
    maxDiffSizeK = 255
    diffSizeK = len(f.data) / 1024
    if (diffSizeK > maxDiffSizeK):
        f.binary = True
        f.data = ""

We didn't submit this as a patch because there's probably a better way of doing it, but if it sounds reasonable we can do so.
david
#1 david
  • +Component-DiffViewer
david
#2 david
I think this is actually a social problem rather than a technical one. If your users are posting code reviews of auto-generated code that aren't reviewable, then just hiding it in the UI isn't really helping anything.
  • +WontFix