From 5e3c5db727c135757d2f7309bbfcae4d579bb709 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Fri, 20 Jul 2012 05:12:11 +0000 Subject: [PATCH] Don't show unclean in version string for now Showing whether the git repository is clean at the time of build will be useful, but currently something in our bootstrap/configure/early make process is causing the tree to look unclean at just the wrong moment and clean builds are showing up as unclean. --- build/print_git_revision.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/print_git_revision.c b/build/print_git_revision.c index 6b11646c8e..7358003832 100644 --- a/build/print_git_revision.c +++ b/build/print_git_revision.c @@ -9,6 +9,8 @@ #include #include +static int show_unclean = 0; + static int sys(char *buf, int buflen, char *cmd) { int i, p[2]; if (pipe(p)) return 255; @@ -50,7 +52,7 @@ int main(int argc, char **argv) { if ((sys1(xcommit,sizeof(xcommit),"git rev-list -n1 --abbrev=10 --abbrev-commit HEAD"))) return 1; snprintf(xver,sizeof(xver),"+git~%s~%s",xfdate,xcommit); - if ((sys(NULL,0,"git diff-index --quiet HEAD"))) { + if (show_unclean && (sys(NULL,0,"git diff-index --quiet HEAD"))) { char buf[256], now[256]; time_t now_t=time(NULL); struct tm *now_tm; if (!(now_tm=gmtime(&now_t))) return 1; strftime(now,sizeof(now),"%Y%m%dT%H%M%SZ",now_tm);