]> rtime.felk.cvut.cz Git - novaboot.git/blobdiff - contrib/hooks/pre-commit
Add pre-commit hook that I use in my repo
[novaboot.git] / contrib / hooks / pre-commit
diff --git a/contrib/hooks/pre-commit b/contrib/hooks/pre-commit
new file mode 100755 (executable)
index 0000000..4258480
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# git pre-commit hook
+
+set -e
+
+# Make README.md be always in sync with novaboot - work with objects
+# in the index (what is being committed), not with what is in the
+# working tree.
+hash=$(git show :novaboot | pod2markdown | git hash-object -w --stdin)
+git update-index --cacheinfo 100644 $hash README.md