This generates a useful version string even for --depth=1 checkouts. The option was added in git v1.6.6.