From 434f80809564482835fc8ac816c536667c1b4547 Mon Sep 17 00:00:00 2001 From: Jan Mrna Date: Thu, 30 Oct 2025 15:18:41 +0100 Subject: [PATCH] Added sample file for git hook --- scripts/pre-commit.sample | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 scripts/pre-commit.sample diff --git a/scripts/pre-commit.sample b/scripts/pre-commit.sample new file mode 100644 index 0000000..535c259 --- /dev/null +++ b/scripts/pre-commit.sample @@ -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