This has to have come up before but I can't find it.
In our pull requests we want to enforce two things:
1 - the feature branch is squashed (ie it is only one commit)
2 - that it can be added to the target branch using ff-only.
Standard behaviour, nothing weird at all.
However, after using pull requests using this for a while:
--ff-only
If the source branch is out of date with the target branch, reject the merge request. Otherwise, update the target branch to the latest commit on the source branch.
We had several instances where the branches were not squashed by the developer before starting the request, and a sloppy review (self review) would allow that through.
When changing to this:
--squash --ff-only
If the source branch is out of date with the target branch, reject the merge request. Otherwise, combine all commits into one new non-merge commit on the target branch.
Even for a single commit branch, Bitbycket changes the commit and edits the commit message.
All I really want is for Bitbucket to reject a non-squashed branch, is this at all possible?
Update on this problem:
Even when everything is ready for a single commit, fast forward only, commit. Bitbucket sometimes choses to owerwrite the commit message with a useless default message.