Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-9243

Background pull request merge should use default merge strategy



    • Suggestion
    • Status: Closed (View Workflow)
    • Resolution: Won't Fix
    • None
    • None
    • None
    • 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.


      I am currently using Bitbucket Server 4.7.1 and git 2.8. In this version of Bitbucket Server pull requests are being blocked by certain submodule modifications that git can't handle when using the no fast forward strategy.


      Let's say I create a submodule in a repo on the master branch and then in a later commit use the git mv command to move that submodule to a different file path. If I then attempt to merge my moved submodule via pull request into the master branch the pull request will be blocked saying that there is a merge conflict. This is because the background merge uses the no-ff option when computing the trial merge. If I perform the merge locally, git elects to use a fast forward merge strategy and the merge is able to complete successfully. In other words, using the --no-ff option is causing the merge with the submodule change to fail. The workaround is to perform the merge locally and then push to the target branch, effectively ruining our pull request only workflow.

      In Bitbucket Server 4.9 the merge strategy capabilities have been updated to allow a user to choose which merge strategy to use when performing the merge. This makes it possible to use the fast forward strategy when merging a pull request with an above described submodule change and merge the pull request successfully. However, and here is the suggestion for future improvement, the background trial merge does not use the default merge strategy defined for the repository. This means that even though the default merge strategy is fast forward, the user will see a message like Bitbucket Server could not create the merge diff for this pull request because the background merge still uses the --no-ff strategy and now the user will have to bravely attempt the merge not sure if it will succeed or if they're doing the right thing. I think it would be great if the default merge strategy was the one used for the background merge. If would also be nice if git could handle submodule moves in a non-fast forward fashion but I'll take that up with the git people themselves.


      Edit: there seems to be a bug in JIRA that isn't letting me type --no-ff easily, fyi.


        Issue Links



              Unassigned Unassigned
              9472f696f743 John Gunnison
              0 Vote for this issue
              6 Start watching this issue