aboutsummaryrefslogtreecommitdiff
path: root/utils/hooks/pre-commit
diff options
context:
space:
mode:
authorChristian Cleberg <hello@cleberg.net>2025-01-24 20:26:20 -0600
committerChristian Cleberg <hello@cleberg.net>2025-01-24 20:26:20 -0600
commitdbcec87682afbb2d2bcb3fbeb397a94441a1f8cd (patch)
tree1667b7286fab00f5a12d0dff04088ba1d0e41ffc /utils/hooks/pre-commit
parent927eefd776aaf6dc89dd6b120303104eb52d5c38 (diff)
downloadcleberg.net-dbcec87682afbb2d2bcb3fbeb397a94441a1f8cd.tar.gz
cleberg.net-dbcec87682afbb2d2bcb3fbeb397a94441a1f8cd.tar.bz2
cleberg.net-dbcec87682afbb2d2bcb3fbeb397a94441a1f8cd.zip
add more git hooks
Diffstat (limited to 'utils/hooks/pre-commit')
-rw-r--r--utils/hooks/pre-commit8
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/hooks/pre-commit b/utils/hooks/pre-commit
new file mode 100644
index 0000000..69883fc
--- /dev/null
+++ b/utils/hooks/pre-commit
@@ -0,0 +1,8 @@
+# .git/hooks/pre-commit
+#!/bin/bash
+for file in $(git diff --cached --name-only | grep -E '\.org$'); do
+ if ! grep -q "^#\+TITLE:" "$file"; then
+ echo "Error: $file is missing a TITLE."
+ exit 1
+ fi
+done