Skip to content
Closed
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
11 changes: 9 additions & 2 deletions advanced/Exercise_7_git-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,18 @@ Integrate another *pre-commit* hook from the above repository into your workflow

# This is the main pre-commit hook script.

# Track whether any hook fails.
# 0: all checks have passed so far;
# 1: at least one check failed.
status=0

# Run the whitespace check script.
.git/hooks/pre-commit-whitespace
.git/hooks/pre-commit-whitespace || status=1

# Run the name and email verification script.
.git/hooks/pre-commit-verify-name-and-email
.git/hooks/pre-commit-verify-name-and-email || status=1

exit $status
```

> **Hint:** Don't forget that all scripts need to be executable!
Expand Down