Update revision scripts to handle case when .git is missing (e.g. in source tarballs)