Comparison of a Pull Request Diff between Bitbucket Server and Data Center versions up to 6.x and from 7.x onwards

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

     

Summary

The Pull Request Diff experience has changed between all the Bitbucket versions up to 6.x and Bitbucket 7. As announced in the Bitbucket 7.0 Release Notes:

We’ve made the switch from a 3-way diff to a 2-way diff in pull requests. This means that from Bitbucket Server 7.0 and later, when viewing a pull request, the diff shown is one between the tip of the source branch and its common ancestor with the target branch. The UI will still indicate when a pull request has conflicts, but they will no longer be marked up in the diff. Use of a 2-way diff is an industry-standard and reduces CPU load on large instances.

What does it mean in action?

Diagnosis

Let's consider a repository with only one file in a master  branch:

master/file.txt
This is a line in a master branch.
This is a line in a master branch.
This is a line in a master branch.

Let's create two branches out of the master branch: branch_A  and branch_B.

Now let's modify file.txt on both branches by updating different lines in each of them:

branch_A/file.txt
This is an edit in branch_A.
This is a line in a master branch.
This is a line in a master branch.
branch_B/file.txt
This is a line in a master branch.
This is an edit in branch_B.
This is a line in a master branch.

In the last step, let's create three Pull Requests in both Bitbucket 6.10 and Bitbucket 7.15:

  • branch_A  → master 
  • branch_B  → master 
  • branch_A  → branch_b 


Steps

Bitbucket 7

Bitbucket 6

branch_A  → master 

branch_B  → master 

branch_A  → branch_b 

As you can see in the last comparison - in Bitbucket 6 the Pull Request Diff presents a direct comparison between branch_A and branch_B.

In Bitbucket 7 however, the comparison is presented between branch_A (the source branch) and the common ancestor of both branch_A and branch_B, which in that particular case is the last commit in the master branch. In other words - the last commit shared between the source and the target.

Please be advised that in both cases, a conflict was detected, as the same file was modified on source and destination.

Cause

We have switched the way we calculate Pull Request Diffs from 3-way diffs to 2-way diffs. The change is permanent and there's no configurable parameter to bring the 3-way diff experience back.
More information on the change can be found in:

Solution

The example above is the expected behaviour in Bitbucket from version 7.0 onwards. Please make sure that your developers are aware of the change and adjust the internal processes accordingly.


Last modified on Feb 4, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.