Skip to end of banner
Go to start of banner

What is a difference between Pre-receive Hook and Merge Check?

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

The goal of a Pre-receive (push) Hook is to validate all incoming commits as they first appear in repository. So, if changes are validated once, and they won’t be checked by the pre-receive hook again.

Merge Check validates all commits included into Pull Request (YACC does this even if they were checked already). This allows to postpone validation until PR merge, rather than at the time the changes are pushed. If you haven’t enabled push-hook, incoming changes will not be validated during push.

Note, that Pull Request merge may create new commits with new hashes, which haven’t been validated yet, so push-hook should step in here and validate them on merge. This may happen in cases like these:

  1. merge-commit for this pull-request: can be excluded by Exclude Merge Commits option

  2. history-modifying commits, created with fast-forward merge strategies: just don’t use these strategies

  3. commits introduced by fork / sync / resolve-conflicts / upmerge workflows: rather rare case

You can use Pre-receive Hook and Merge Check independently, with a separate sets of settings. Or you may enable them both together, to combine validation of some rules as they are committed and postponing some checks until Pull Request merge.

  • No labels