Pull Request diff is not shown or shown as empty.
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
The diff shown in a Pull Request says "The diff for this file is empty" for some files. There are a couple of reasons why this occurs, and we listed these reasons below.
Solution
Scenario 1
Cause 1
This issue generally occurs when the changes made between branches of a Pull Request only contain spaces. There is a setting within each Pull Request to not show "Whitespace changes". When the Pull Request diff is evaluated, if the diff only contains whitespaces, the diff is not shown if the "Whitespace changes" option is left unchecked.
Solution 1
To resolve this issue,
Go to Settings within a Pull Request
Make sure the Whitespace Changes option is checked

Below are two screenshots for comparison -

ℹ️ Whitespace Setting is unchecked

ℹ️ Whitespace Setting is checked
Scenario 2
Diagnosis 2
When viewing a commit or a pull request in Bitbucket Cloud, you will see a message stating that the diff is empty or that the contents are unchanged, like the examples below:
Example from the Pull request page:

Example from the Commits page:

Cause 2
The contents of the file in question have truly not changed. However, Git keeps track of file-system permission changes, and this is the reason why you see the file on the diff in Bitbucket Cloud.
In order to figure out exactly what changed on the file, run the following command, where <commit_hash> is the SHA of the affected commit:
1
git show <commit_hash>
You should see an output like the following, which indicates what exact file-system permissions have been changed in that commit:
1
2
3
[...]
old mode 100644
new mode 100755
If none of the above is the case, the most likely scenario is a browser issue. So, the recommendation is:
Try loading the diff on an incognito window
Try disabling all browser extensions before loading the page. If that works, remove the extensions one by one to find out what is the culprit extension.
If you are encountering issues following this documentation - please raise a support ticket or a community support ticket for further assistance.
Was this helpful?