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

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

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.

*Fisheye および Crucible は除く

     

要約

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?

診断

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 


手順

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.

原因

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:

ソリューション

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.


最終更新日: 2024 年 2 月 4 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.