Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-13144

Context expansion and syntax highlighting for pull request diffs for large files

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • Pull Requests, UI
    • None
    • 2
    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      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

      1. In the PR diff, click "View the entire source for this file"
      2. In the Source view, click "Diff to previous"

      Workaround 2

      1. Set page.max.diff.lines=<number of lines in your largest file you expect to work with> in the bitbucket.properties file
      2. Restart Bitbucket

      Note: This setting can cause performance overhead. It is recommended to test this setting in a controlled environment first.

            [BSERV-13144] Context expansion and syntax highlighting for pull request diffs for large files

            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.

            Kent Rogers added a comment - 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.

              Unassigned Unassigned
              jmariano@atlassian.com JP Mariano
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: