sapling/eden/mononoke/metaconfig
Kostia Balytskyi c85fe51f5f hooks: allow two types of bypasses for the same hook
Summary:
There seem to be legitimate cases when we want to have both bypass mechanisms available: via the commit message and via the pushvar. The need to be able to use a commit message arises from the fact that engineers rarely have access to push CLI, so they cannot use pushvars. Still, pushvars are useful if we want to push an existing commit without any changes to its message.

NB. Since I wanted to make `HookBypass` a multi-option, I had to change it from `enum` to `struct`. If I left fields `pub` in that struct (the way it's commonly done in `metaconfig`, I would've allowed `HookBypass` instances with both options `None`. This is not a big deal, but is a bit ugly as we already store `Option<HookBypass>` instead, so it's better if `Some(hook_bypass)` symbolizes that there indeed is some way to bypass the hook. So I opted in for constructors, getters and private fields.

Reviewed By: StanislavGlebik

Differential Revision: D25000578

fbshipit-source-id: ad13076c9690ee8d45fc4a93e32a6026ff5bdd09
2020-11-17 06:02:30 -08:00
..
parser hooks: allow two types of bypasses for the same hook 2020-11-17 06:02:30 -08:00
types hooks: allow two types of bypasses for the same hook 2020-11-17 06:02:30 -08:00