The diff algorithm from NGit.