Skip to content

Commit 6d2c444

Browse files
committed
hooks/precommit: Added some additional comments.
1 parent 3a1e2b3 commit 6d2c444

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hooks/precommit

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
# Author: Jonathan Davies <jpdavs@gmail.com>
66
#
77

8+
# Stash changes unrelated to the commit in Git.
89
echo "$(date -R): Stashing unrelated changes in Git..."
910
git stash -q --keep-index
1011

12+
# On exit, revert the stash done above.
1113
trap 'echo "$(date -R): Reverting Git stash..."; git stash pop -q' EXIT
1214

13-
# Only run tests if our rulesets have been changed.
1415
RULESET_PATTERN="src/chrome/content/rules/"
1516
CHANGED_RULESETS="$(git diff --cached --name-only | grep $RULESET_PATTERN)"
1617

1718
if [ "$CHANGED_RULESETS" ]; then
19+
# Only run tests if our rulesets have been changed.
1820
echo "$(date -R): Running ruleset validation tests on changed rulesets:"
1921

2022
for FILE in $CHANGED_RULESETS; do
@@ -23,6 +25,7 @@ if [ "$CHANGED_RULESETS" ]; then
2325
continue
2426
fi
2527

28+
# Errors will go to stderr.
2629
./utils/trivial-validate.py $FILE > /dev/null
2730
RESULT=$?
2831

0 commit comments

Comments
 (0)