We use bitbucket server as our source repository. I'm not sure if that is relevant to this if it can be solved with a vanilla git hook.
We have the current workflow:
Developer commits to a branch, creates a pull request. Reviewers reply with feedback to code, and developer proceeds to make 'fix' commits based on feedback which will eventually be rebased away after the branch is approved. This allows the reviewers to click on the commit and see diffs between the original pr (which they already reviewed) and the change based on feedback. In order to make it easy for reviewers to distinguish, fix commits all have the prefix 'FIXUP' in their commit message.
This workflow works really well for us, however sometimes the developer will forget to rebase the fixup commits into their branch and we end with our master branch having a bunch of commit messages titled FIXUP:...
Is it possible to write a hook that prevents merges to master where there are commits with messages starting with a certain string? In addition, is it also possible to make this evident in bitbucket's ui?
EDIT: Between GlennV's answer and git hook: ensure each merge into the master has a message also the automatic merges I think I can get some working, thanks everyone!