Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

Commit checker is not respected when merging a commit via a pull-request. #83

Open
coreycsteele opened this issue Apr 3, 2018 · 3 comments

Comments

@coreycsteele
Copy link

  1. Create and clone a new repo locally
  2. In Bitbucket go to Settings -> Hooks
  3. “Enable” the Simple Bitbucket Commit Checker
  4. Go all the way to the bottom and click
  • Click on “New rule Group”
    • Matching commits are “Accepted”
    • The group matches a commit if “no rules match”
  • Click on “New Rule”
    • For the regex to match type in something like “OOPS”
    • Add a message to the commiter: “Please remove OOPS from commit message”
  1. Save the hook

What happens if you leave the branch field empty to work on all branches.
Then the hook prevents the push to the branches.

For sake of arguement why would you disallow this for only master?
We have our reviewers listed out in the commit message.
Our default commit message template fills out the default commit message with the words “Reviewed by NOBODY (OOPS!)” as there is no reviewer until after it goes through code review.

We use the commit checker to make sure the worrd “OOPS” is not in any commit message when commiting to master or release branches.

@tomasbjerre
Copy link
Owner

What exactly do you mean by "Then the hook prevents the push to the branches."?
Are you saying that you want to use the hook only on master-branch?

@kocsenc
Copy link

kocsenc commented Apr 3, 2018

What exactly do you mean by "Then the hook prevents the push to the branches."?
Are you saying that you want to use the hook only on master-branch?

That's exactly right.

Please note it is possible now to set a hook to only run on master but the main point here is that when you use a Pull Request to merge your changes from branch x => master that hook is not respected.

I anticipate bitbucket is not running the commits through the commit checker at PR-merge-time.

@kocsenc
Copy link

kocsenc commented Apr 16, 2018

Cannot reproduce using Bitbucket Server v. 5.8.2. Feel free to close unless anyone else can repro.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants