Protect against builds without related commits
Handle older versions of Git