]> git.phdru.name Git - git-scripts.git/commitdiff
Add post-merge and post-rewrite hooks
authorOleg Broytman <phd@phdru.name>
Tue, 9 Feb 2016 18:48:15 +0000 (21:48 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 9 Feb 2016 18:48:15 +0000 (21:48 +0300)
These hooks compile python files to byte code.

hooks/post-merge [new file with mode: 0755]
hooks/post-rewrite [new file with mode: 0755]

diff --git a/hooks/post-merge b/hooks/post-merge
new file mode 100755 (executable)
index 0000000..3bdcf5e
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# post-merge hook that compiles python files to byte code
+
+python2.7 -m compileall -q . &&
+python2.7 -O -m compileall -q .
+
+exit 0
diff --git a/hooks/post-rewrite b/hooks/post-rewrite
new file mode 100755 (executable)
index 0000000..02466f9
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# post-rewrite hook that compiles python files to byte code
+
+python2.7 -m compileall -q . &&
+python2.7 -O -m compileall -q .
+
+exit 0