Issue #3369 open

Allow pull request receiver to change destination branch (BB-3232)

Anonymous created an issue

Currently, during a pull-request it is not possible to change the destination branch to be a different branch than the issuer specified.

It is possible to create a new branch on pull with the same name as the source branch, but this must be done on the issuer side. If the issuer is proposing a merge into master, I don't necessarily want the code to be merged into master without running my own test suites.

The request can be rejected and then asked to change the destination branch, but this is clunky. I could pull directly from their repository, into my local copy before pushing to my online repository but this makes it more difficult to perform larger peer reviews --> telling everyone to pull from that branch instead of just pulling the latest copy from the blessed repository is not intuitive. I also cannot do this if their fork is private.

I propose the owner of the destination repository should be able to change the destination branch before pulling into his repository from the pull-request UI.

This is how I work locally when interacting with colleagues in my office, so being able to work like this from Bitbucket would be very convenient.

Comments (11)

  1. Erik van Zijst staff

    @EvSpirit

    It seems I've found a work-around. The problem is the following: when I created a fork with a test user, I unchecked "Inherit repository user/group permissions". I that case I didn't have any rights (read/write/admin) for the created fork.

    Now If I log in with a created user and add read/write rights for my main account, I'll get "Edit" button on a "Pull Request" page and I'll be able to change a branch I want the code to merge into. I don't think it's a right case, I suppose I should have a chance to change a branch despite my access rights.

    Thanks!

  2. Simon Hampel

    As mentioned briefly by the original poster, there is a workaround for this - it's cumbersome, but it works for simple requests.

    If you have read access to the requester's repository, you can add their repo as a new remote in your Git client, then pull the branch from their repo into which-ever branch you choose locally.

    Then, you make your changes and once you are happy, merge into master or where-ever.

    Once you push all the changes back to Bitbucket, Bitbucket is smart enough to detect that the pull request has been merged and will automatically mark it so.

    It's not ideal - especially if you get lots of pull requests or you need peer review - and it DOES require read access to the source repo (which isn't a given), so it would be much better to simply allow the repo owner to change the destination branch for pull requests, as requested by the OP.

  3. Log in to comment