aboutsummarylogtreecommitdiffstats
path: root/pre-commit.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pre-commit.sh')
-rwxr-xr-xpre-commit.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/pre-commit.sh b/pre-commit.sh
new file mode 100755
index 000000000000..1cfdd8f132b4
--- /dev/null
+++ b/pre-commit.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+# git pre-commit hook: Generate the .SRCINFO file and add it to the commit if it changed
+
+# Generate the .SRCINFO file based on the PKGBUILD file
+mksrcinfo
+
+# Check if the .SRCINFO file changed
+if [ -n "$(git diff --name-only | grep ^.SRCINFO$)" ]; then
+ printf "Updated .SRCINFO file\n"
+ git diff .SRCINFO
+ git add .SRCINFO
+ printf "\nAdded .SRCINFO file to the commit\n"
+fi