Is it possible to choose the merge strategy on a Pull Request?
There is some reference to such options in the stash-config.properties file in https://jira.atlassian.com/browse/STASH-2857 and https://jira.atlassian.com/browse/STASH-2810, but they are not available in the current doc https://confluence.atlassian.com/display/STASH/Stash+config+properties
Is this option still active in 2.8.2? What are the possible values?
Thanks, Marian
Hi Marian,
We definitely haven't removed the option. I'm not sure why the doc doesn't mention them. The valid options are (still):
Cheers,
Charles
Hi Charles,
thanks for the fast answer.
https://jira.atlassian.com/browse/STASH-2857 mentions "no-ff" being the default option. Is this correct and also a valid value?
Thanks, Marian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marian,
Apologies for not mentioning 'no-ff' - it is the other value, and the default.
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stash 2.9 will add:
This basically combines the "squash" and "ff-only" options, as its name suggests.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's even clearer (accessible from the UI) and better since Bitbucket 4.9, released yesterday https://confluence.atlassian.com/bitbucketserver/checks-for-merging-pull-requests-776640039.html#Checksformergingpullrequests-strategies
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This page has been updated:
https://confluence.atlassian.com/display/STASH/Stash+config+properties
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I want to change the default value no-ff to squash for a project in v4.8.3
From the documentation I see that I need to modify "plugin.bitbucket-git.pullrequest.merge.
strategy.KEY.slug=no-ff".
Can anyone help me how do I that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The best thing to do would be to upgrade to a more recent version of Bitbucket Server, which will allow you to configure the strategy via the UI. Bitbucket Server 4.8 is end of life, and no longer receives bugfixes or security fixes and is no longer eligible for support beyond assistance with an upgrade to a supported version.
In order to change the setting on Bitbucket Server 4.8, you will need to have terminal access to the server on which Bitbucket Server runs (SSH access, console access, etc.) to be able to edit a configuration file on disk. If you do not have access to the server, it is not possible to change the configuration. You'll need to get in touch with an administrator for your organization who does have such access and ask them to make the change for you. (Or, again, better yet, ask them to upgrade your instance.)
If you have server access, you'll need to edit "bitbucket.properties", which will be in "$BITBUCKET_HOME/shared". There won't be an existing line that looks like the example you pasted. Instead, you're intended to substitute your actual project key where "KEY" is, and your actual repository slug where "slug" is and add a new line to the configuration. For example, given a project key of "QA" and a repository slug of "config-example", the property would be "plugin.bitbucket-git.pullrequest.merge.strategy.QA.config-example". If you want to apply the configuration change to all repositories in a given project, leave off the repository slug: "plugin.bitbucket-git.pullrequest.merge.strategy.QA".
You'll add a line with that key, and your desired strategy, save the file and restart Bitbucket Server. Changes are not picked up until the application is restarted.
Valid strategy values are: "ff", "ff-only", "squash", "squash-ff-only" and "no-ff". Setting "no-ff" does nothing, since it's the default strategy the system is already using.
Best regards,
Bryan Turner
Atlassian Bitbucket
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry I didn’t get back to you sooner. I requested them to upgrade complete atlassian stack. I only have read access to server, So I will req. respective one to modify the change and schedule for restart until we get the new BB and JIRA.
Just to summarize, is it possible to have the “Squash” merge option in addition to the existing “Merge commit” option that we currently have today? or it would replace default with squash?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Prior to Bitbucket Server 4.9, it is not possible to configure multiple strategies. Setting on the strategy via `bitbucket.properties` will _replace_ the default "no-ff" strategy with whatever strategy you configure, and all pull requests will be merged that way.
In Bitbucket Server 4.9 and newer, you can enable multiple strategies with one set to be used by default. If only a single strategy is enabled, it will be used automatically for all pull requests. If multiple are enabled, a dropdown will be displayed on the pull request merge dialog, with the default strategy selected initially, and the merger can select the strategy to use.
Best regards,
Bryan Turner
Atlassian Bitbucket
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.