secret-shield icon indicating copy to clipboard operation
secret-shield copied to clipboard

Add repository-local fallback checks for all hooks

Open kkaefer opened this issue 6 years ago • 1 comments

Git offers many different hooks. secret-shield implements only one of them (pre-commit), but it sets core.hooksPath to its hooks directory as per the recommended installation procedure.

Unfortunately, this precludes other hooks (like pre-push) from running altogether, since git only looks in secret-shields hook directory.

This PR creates a common execute_hook.sh function and symlinks all hooks to it. This file checks whether the local directory has a hook with that name and executes it instead, much like the pre-commit has done before. Additionally, it also forwards all arguments so that local hooks receive the correct input.

If there's no repository-local hook, it tries to execute secret-shields hook (stored in a .local file).

kkaefer avatar Sep 26 '18 17:09 kkaefer

bump

kkaefer avatar Nov 19 '18 11:11 kkaefer