-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
2
-
Feature request
Add back context expansion and syntax highlighting for pull request diffs for large files in Bitbucket 7.x.
These were previously available in Bitbucket 6.x.
In Bitbucket 7.x, PR diffs for large files (files over 10K lines, which is set by the page.max.diff.lines property will show the message: "This file is too large to fetch the full context for the diff. Syntax highlighting and context expansion have been disabled. View the entire source for this file"
Bitbucket 7.x sample screenshot
The diff is shown with minimal context (10 lines each side of change) and it is not possible to show more lines.
Bitbucket 6.x sample screenshot
In comparison, in Bitbucket 6.x, it is possible to show more lines as long as the diff doesn't exceed 10K lines
Workarounds
Workaround 1
- In the PR diff, click "View the entire source for this file"
- In the Source view, click "Diff to previous"
Workaround 2
- Set page.max.diff.lines=<number of lines in your largest file you expect to work with> in the bitbucket.properties file
- Restart Bitbucket
Note: This setting can cause performance overhead. It is recommended to test this setting in a controlled environment first.
Yes, the page.max.diff.lines property is now overloaded and used for two purposes, which doesn't make sense.
We want to allow expansion of the diff context in diffs of large files (>10k lines), but we do not want to enable diffs that are >10k lines themselves. There is a big difference. The fact that these two cases have been combined into one property now means that even diffs that are only one line cannot have their context expanded IF they occur within a large file.
We have a lot of files >10k lines in our instance (we checked and found them in 27% of our Pull Requests), and this loss of functionality will result in a large productivity hit for our us.
Please separate these two cases and restore the ability to expand the diff context for PR diffs that are small themselves but occur within a large file.