# .PHONY ensures the .tmp version is always rebuilt (to check for any changes)
.PHONY: gitinfo.tmp
gitinfo.tmp:
- $(AM_V_GEN)(cd "$(top_srcdir)" && sed 's,^ref: refs/heads/,,' .git/HEAD && git show-ref refs/heads/`sed 's,^ref: refs/heads/,,' .git/HEAD` && echo "Modifications: `test -z \"\`git status -s -uno\`\" && echo false || echo true`") >"$@" 2>/dev/null || true
+ $(AM_V_GEN)(cd "$(top_srcdir)"; if ! grep -q '^ref: refs/heads/' .git/HEAD; then echo; fi; sed 's,^ref: refs/heads/,,' .git/HEAD; git show-ref refs/heads/`sed 's,^ref: refs/heads/,,' .git/HEAD`; echo "Modifications: `test -z \"\`git status -s -uno\`\" && echo false || echo true`") >"$@" 2>/dev/null || true
install-data-local:
(echo include/cvc4.h; \
printf("\n");
printf("version : %s\n", Configuration::getVersionString().c_str());
if(Configuration::isGitBuild()) {
+ const char* branchName = Configuration::getGitBranchName();
+ if(*branchName == '\0') {
+ branchName = "-";
+ }
printf("scm : git [%s %s%s]\n",
- Configuration::getGitBranchName(),
+ branchName,
std::string(Configuration::getGitCommit()).substr(0, 8).c_str(),
Configuration::hasGitModifications() ?
" (with modifications)" : "");
return "";
}
+ const char* branchName = getGitBranchName();
+ if(*branchName == '\0') {
+ branchName = "-";
+ }
+
stringstream ss;
- ss << "git " << getGitBranchName() << " " << string(getGitCommit()).substr(0, 8)
+ ss << "git " << branchName << " " << string(getGitCommit()).substr(0, 8)
<< ( ::CVC4::Configuration::hasGitModifications() ? " (with modifications)" : "" );
return ss.str();
}