Right after I finished this we noticed that we could also do this with a post commit hook, so we're planning to implement that as well.