Consider rewriting git hooks in Python
In legacy/trac#30286 (moved) we're looking into fixing pre-push hook to inspect only the commits that originate from the branch being pushed and that seems to be pretty complicated to do with shell scripting alone. As our git hook complexity grows, it may become worthwhile to write them in Python and use some Python module (e.g. GitPython) to have deeper integration with git repository.