for version string, try to handle case where head is detached