Mark Manually Merged Pull Request as Resolved

I have a pull request which for some unknown reason I was not allowed to merge from the Stash website. The Merge button is disabled with the error "This pull request cannot be merged automatically". I could not figure out why as it is a fast forward merge without any conflicts...

There were no instructions on how to manually resolve the merge on the Stash pull request page. I remember previous versions provided instructions which would have been helpful.

So I ran the following commands on locally

git fetch
git checkout master
git merge --no-ff --log cool-feature-branch
git push

The merge commit does include the correct parents (one from master and the other from the single commit on my feature branch) and the merge commit message includes the id of the pull request "Merge pull request #1 in FOO/BarRepo from cool-feature-branch to master". However the pull request remains open and I don't see any way to mark it as resolved and link back the merge commit on master.

Can someone please help me understand why I couldn't merge using the website and how to resolve my pull request?

1 answer

1 accepted

2 votes
Accepted answer

Hi Carolyn,

If you hover over the warning message it will have a link with "More information" that will show you the exact reason(s) that you can't merge. It might not (necessarily) be related to a clean merge, it can also be about other restrictions such as minimum number of reviewers or broken builds if you have any of that configured. If the problem is related to a merge error the instructions will show up as normal on the overview tab saying "This pull request can't be merged".

If you merged and pushed as normal then I would also expect Stash to make the pull request as merged. Is the most recent commit of the PR definitely the same as the commit that you merge locally? That is to say, you haven't done any force pushes that would result in different hashes?

My first thought is that it may be related to this issue:

https://confluence.atlassian.com/display/STASHKB/Pull+Requests+Not+Reflecting+Changes+Pushed+to+Remote+Branch+After+an+Upgrade

If that is not the case, or regardless, you may want to raise a support ticket.

Regarding your currently open PR, I would suggest just declining it. There isn't any way to "mark" it as merged but not do any work. I'm not quite sure what you would happen if you merged and the commit was already included in the target branch (it shouldn't be possible to get into that state).

Cheers,

Charles

Apologies for the late reply...

Thank you for the suggestion to look for a hover tooltip. It was not at all intuitive that was where the critical information of why I couldn't merge would be located. Hopefully in a later release that information is displayed directly on the screen but at least I know where to find it now. :-)

Funny thing is that when another pull request was merged the other day, that magically marked my open pull request as closed. I guess the branch in that pull request included the commit from the original one that became stuck.

I never did find out why it wasn't closed when I manually merged it but if it happens again, I'll open a support ticket.

Maybe this will help fixing this issue:

I had exactly the same problem. I created a branch A and created another branch AB from that. After a manual merge of Branch A, Bitbucket did not recognize the change. After pressing the merge button in the PR I got the following error message:

 

The merge could not be completed automatically. Please clone 'NAME_OF_THE_REPO', checkout 'develop' and merge 'BRANCH_A' (or commit '7408b10a34f1faa4e047ff42cd9ab315faba72c6') manually, resolving any conflicts, and push the result.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

234 views 3 7
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you