Script handles all types of updates correctly

The script was re-written in Python to allow for flexible parsing of
`git diff --raw` output.