--- /dev/null
+#!/bin/sh
+
+# post-checkout hook that compiles python files to byte code
+# if branch was changed
+
+prev_HEAD="$1"
+new_HEAD="$2"
+new_branch="$3"
+
+if [ \( "$new_branch" = 1 \) ]; then
+ python2.7 -m compileall -q . &&
+ python2.7 -O -m compileall -q .
+fi
+
+exit 0
--- /dev/null
+#!/bin/sh
+
+# post-checkout hook that change timestamps on files to that one of the commit
+# if branch was changed
+
+prev_HEAD="$1"
+new_HEAD="$2"
+new_branch="$3"
+
+if [ "$new_branch" = 1 ]; then
+ commit_date="`git show --format='%cD' \"$new_HEAD\" | awk '{if (NR==1) print}'`" &&
+ find . \( -name .git -type d -prune \) -o -exec touch --date="$commit_date" '{}' \+
+fi
+
+exit 0