move to script/template model
fix bug when running gitpython via hook

repo.is_dirty() was causing error so wrapped in function to handle potential error