From dbcec87682afbb2d2bcb3fbeb397a94441a1f8cd Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Fri, 24 Jan 2025 20:26:20 -0600 Subject: add more git hooks --- utils/hooks/pre-commit | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 utils/hooks/pre-commit (limited to 'utils/hooks/pre-commit') 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 -- cgit v1.2.3-70-g09d2