Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/hooks/applypatch-msg
1 change: 1 addition & 0 deletions config/hooks/commit-msg
17 changes: 17 additions & 0 deletions config/hooks/execute_hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

HOOK=$(basename $0)

# Execute a repository-local hook first.
LOCAL_HOOK=$(git rev-parse --show-toplevel 2>/dev/null | sed -e "s/\$/\/.git\/hooks\/$HOOK/")
if [ ! -z "$LOCAL_HOOK" ] && [ -x "$LOCAL_HOOK" ]; then
exec "$LOCAL_HOOK" "$@"
exit 1
fi

# If there's no repository-local hook, try executing a secret-shield hook if it exists.
SHIELD_HOOK=$(dirname $0)/$HOOK.local
if [ -x "$SHIELD_HOOK" ]; then
exec "$SHIELD_HOOK" "$@"
exit 1
fi
1 change: 1 addition & 0 deletions config/hooks/fsmonitor-watchman
1 change: 1 addition & 0 deletions config/hooks/p4-pre-submit
1 change: 1 addition & 0 deletions config/hooks/post-applypatch
1 change: 1 addition & 0 deletions config/hooks/post-checkout
1 change: 1 addition & 0 deletions config/hooks/post-commit
1 change: 1 addition & 0 deletions config/hooks/post-merge
1 change: 1 addition & 0 deletions config/hooks/post-receive
1 change: 1 addition & 0 deletions config/hooks/post-rewrite
1 change: 1 addition & 0 deletions config/hooks/post-update
1 change: 1 addition & 0 deletions config/hooks/pre-applypatch
1 change: 1 addition & 0 deletions config/hooks/pre-auto-gc
20 changes: 0 additions & 20 deletions config/hooks/pre-commit

This file was deleted.

1 change: 1 addition & 0 deletions config/hooks/pre-commit
4 changes: 3 additions & 1 deletion config/hooks/pre-commit.local
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/sh

if [ -z "$NVM_DIR" ]; then
# Try enabling NVM if we can't find secret-shield.
if [ ! command -v secret-shield >/dev/null 2>&1 ] && [ -z "$NVM_DIR" ]; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
fi

# Fail gracefully even if we couldn't find secret-shield in the NVM installation.
command -v secret-shield >/dev/null 2>&1 || {
echo >&2 "WARNING! Could not check for secrets because the secret-shield package is either not installed or misconfigured (command not found)."
exit 0
Expand Down
1 change: 1 addition & 0 deletions config/hooks/pre-push
1 change: 1 addition & 0 deletions config/hooks/pre-rebase
1 change: 1 addition & 0 deletions config/hooks/pre-receive
1 change: 1 addition & 0 deletions config/hooks/prepare-commit-msg
1 change: 1 addition & 0 deletions config/hooks/push-to-checkout
1 change: 1 addition & 0 deletions config/hooks/rebase
1 change: 1 addition & 0 deletions config/hooks/sendemail-validate
1 change: 1 addition & 0 deletions config/hooks/update