review comments: less magic
refactor rev-parse + more tests
remove indirection in purge
tests for prune