Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Add repository-local fallback checks for all hooks #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kkaefer
Copy link

@kkaefer kkaefer commented Sep 26, 2018

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 kkaefer requested review from elfakyn and removed request for elfakyn October 4, 2018 20:08
@kkaefer
Copy link
Author

kkaefer commented Nov 19, 2018

bump

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

Successfully merging this pull request may close these issues.

1 participant