Add diff support

Possibly needs some changes and tests on bigger repos, but might be good enough as a starting point.