How to prevent updates to pull request

Is there any plugin to control the updates to an open pull request? Once the requester has submitted the pull request for a branch, they should not be able to update it. Either the pull request is to be automatically denied or should prevent updates to the branch.

4 answers

This widget could not be displayed.

As well as the plugin Balazs suggested, there is another Add-on you will likely find useful called ScriptRunner for Stash.

You can read the documentation about the functionality, ScriptRunner for Stash too can withdraw approvals whenever a Pull Request changes.

It also gives you the ability to control a number potentially undesired events as a Pre-Hook (i.e before the git push is successful).

There is a short video available about the typical Pre-Hooks you might use so you can quickly assess if you might find it useful. The other functionality you will likely find useful is the Auto Add Reviewers to Pull Requests video.

I hope it helps.

This sounds like a) overkill for the task at hand (both in price and complexity) and b) an advertisement for your product rather than an actual answer to the question.

Balazs, thanks for your comment. a) I thought I'd give Harish the information. b) yes, it is an advert with the intent of helping at the same time. Perhaps next time I will stick to answering the question and not throw in extra features.

This widget could not be displayed.

In general, pull requests have to be updateable, otherwise it would be impossible to fix problems with the code changes discovered during review. To make sure that only the approved changes actually get merged, you can do either of these:

  • Have the reviewer merge the PR, right after approving it
  • Install this plugin and then in the pull request settings of the repo:
    • set "Requires N approvers" to 1 (or more) and enable it
    • also enable "Unapprove all reviewers when the source branch of a pull request changes"

N.B. In both of these cases, it is still possible to remotely merge(*) the pull request with unapproved changes, as long as the author has write access to the target branch.

(*) Merge the source branch to the target in a Git client and push the merge commit.

This widget could not be displayed.

Why? That appears not productive to me. There is a plugin to automatically unapproved on updates, I find that more useful.

This widget could not be displayed.

In a sense that when the requester has sent me a request to merge, the branch is considered to be finished and ready there should be no more updates to it. Let us say that the approver has approved the request, in the time between approving and merging , any more updates should not be accepted.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,337 views 8 11
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