Simplify single and collection diff file limits
As documented on https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18269/diffs, we have way too many diff limit variations through the codebase. These are applied on _commit_, _compare_ and _merge request_ views.
Ideally we should simplify it in order to be confident when making a change on these limits. I still don't have a concrete proposal for it, be these are a couple of thoughts and concerns:
- [Collapsing based on safe limits](https://gitlab.com/gitlab-org/gitlab-ce/blob/132f7d33a92d69b163ed5c8a8d8dfd394da12a26/lib/gitlab/git/diff_collection.rb#L136-138) just exists for Rugged apparently. Should it happen for Gitaly calls as well?
- [`Commit::COMMIT_SAFE_LINES`](https://gitlab.com/gitlab-org/gitlab-ce/blob/132f7d33a92d69b163ed5c8a8d8dfd394da12a26/app/models/commit.rb#L25) is really [needed](https://gitlab.com/gitlab-org/gitlab-ce/blob/132f7d33a92d69b163ed5c8a8d8dfd394da12a26/app/views/projects/diffs/_text_file.html.haml#L1-4)? It seems like we already handle the collapse view through [`viewer.collapsed?`](https://gitlab.com/gitlab-org/gitlab-ce/blob/132f7d33a92d69b163ed5c8a8d8dfd394da12a26/app/views/projects/diffs/_viewer.html.haml#L6-7) (i.e. It uses [`COLLAPSE_LIMIT`](https://gitlab.com/gitlab-org/gitlab-ce/blob/132f7d33a92d69b163ed5c8a8d8dfd394da12a26/lib/gitlab/git/diff.rb#L31) )
- Is [safe_max_*](https://gitlab.com/gitlab-org/gitlab-ce/blob/132f7d33a92d69b163ed5c8a8d8dfd394da12a26/lib/gitlab/git/diff_collection.rb#L19-20) limits always used in a _collapsing_ context? I wonder if we should make it explicit
issue