Added sample file for git hook

This commit is contained in:
Jan Mrna
2025-10-30 15:18:41 +01:00
parent 9c1ec01ce0
commit 434f808095

View File

@@ -0,0 +1,9 @@
#!/bin/sh
# Copy this file to .git/hooks
# Run clang-format before commiting
files=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(cpp|hpp)$')
[ -z "$files" ] && exit 0
clang-format -i $files
git add $files