https://bugzilla.mozilla.org/show_bug.cgi?id=718115 (which is about a copy of Versioneer that I put into Jetpack) is about a leaked error message that occurs when the version-determining code tries to run git describe in a tree that has no .git directory. (In jetpack's case, this is because we have a git-to-mercurial bridge to support some legacy test automation, so they're running code that comes from an hg checkout, which of course has no .git directory).
The version-checking code correctly resolves version="unknown", but emits a scary "fatal: Not a git repository" message to stderr in the process.
The fix is to do an extra os.path.isdir(".git") check before calling git describe, and return None if .git is not present.
https://bugzilla.mozilla.org/show_bug.cgi?id=718115 (which is about a copy of Versioneer that I put into Jetpack) is about a leaked error message that occurs when the version-determining code tries to run
git describein a tree that has no .git directory. (In jetpack's case, this is because we have a git-to-mercurial bridge to support some legacy test automation, so they're running code that comes from an hg checkout, which of course has no .git directory).The version-checking code correctly resolves version="unknown", but emits a scary "fatal: Not a git repository" message to stderr in the process.
The fix is to do an extra
os.path.isdir(".git")check before callinggit describe, and return None if.gitis not present.