Alternate fix for #68

This is an alternate to #68, and also fixes astropy/astropy#2821 as well as the deeper issue of supporting git revision counts with git versions older than 1.7.2.