I have a pre-commit hook working for building my blog! Some things I found out:
- Here also it's necessary to explicitly specify git-dir and work-tree in order for git commands to work. As I mentioned in a previous post, my build script uses git log, so I had to add those to the script as well.
- Python virtual environments made with virtualenv work just fine inside a git hook! You just source the activation script as normal. I'm glad this worked so painlessly.
Here's the hook in entirety for reference:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|