tvdstaaij / node-git-describe

Git describe information at runtime, with semver support
36 stars 5 forks source link

When there is no tag in the repository, "+NaN" is returned #2

Closed james-hu closed 9 years ago

james-hu commented 9 years ago

When there was no tag in the repository, I got "+NaN.74edeea.dirty" as the return value of: gitDescribe(undefined, {customArguments: ["--always"]}).semverString;

I guess it was caused by an invalid value of distance.

tvdstaaij commented 9 years ago

This was fixed together with #1, the code just didn't expect the output git gives with --always when there are no tags (i.e. just a commit hash). Wanted to make one little remark -- you can just pass in your config object as the first argument (gitDescribe({customArguments: [...]})), no need to explicitly skip it with null/undefined :wink:

james-hu commented 9 years ago

thanks for quick response and the hint!