"The diff for this file is too large to render" - Can the limit be increased?

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2014

When trying to display the diff of a (long) file in a commit, I get "The diff for this file is too large to render." instead of the diff.

- What is the upper limit of the file size that Stash is still willing to display?

- Is there a way to increase this limit?

3 answers

1 accepted

3 votes
Answer accepted
Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 21, 2014

Balasz,

Stash applies two limits to diff rendering to limit memory usage:

# Maximum length for any line returned from a given file when viewing source. This value truncates long lines. There is no mechanism for retrieving the truncated part short of downloading the entire file.

page.max.source.length=5000

# Maximum number of segment lines (of any type, total) which may be returned for a single diff. Unlike other page limits, this is a hard limit; subsequent pages cannot be requested when a diff exceeds this size.

page.max.diff.lines=10000

Both settings can be overridden in STASH_HOME/stash-config.properties. You'll need to restart Stash to pick up the updated configuration.
Cheers,
Michael
Ben Howell December 16, 2015

Does anyone know where this setting is for Bitbucket server 4.1? That file doesn't seem to exist (also checked replacing the stash with bitbucket)

Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 16, 2015

It's now called bitbucket.properties and should be created in BITBUCKET_HOME/shared/

Like Kanishka likes this
Ben Howell December 17, 2015

Thanks i found it where you suggested!

0 votes
Aura Heinz August 6, 2014

Does anyone have a good feel for the impact on system performance if we increase the defaults by a factor of 10?

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 7, 2014

It depends quite much on how many users are doing what exactly. If large diffs are relatively rare compared to all the other things the server does, it will not have a significant performance impact. Try for an hour or a day and keep track of the performance indicators of the server.

(I did increase this by a factor of 10 to to 50k. We have so many users, and so few huge diffs that it did not really make a difference in the performance.)

0 votes
Peter Van de Voorde
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 21, 2014

Hi Balazs,

Could this help you out?

https://confluence.atlassian.com/display/STASHKB/Pull+request+is+too+large+to+render

Best regards,

Peter

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2014

I found this myself as well. That question is about the number of files in a pull request, i have a problem with the number of lines in one file. So I guess it doesn't solve my problem.

Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 21, 2014

That won't work; that settings defines the limit of the number of changes (path elements) that's renderable in a pull request.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events