Refine the build id string
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 11 Jun 2012 16:06:30 +0000 (12:06 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 11 Jun 2012 16:15:46 +0000 (12:15 -0400)
We use git describe to get the SHA1 so that we append -dirty for dirty
worktrees and include the HEAD commit subject and date.

src/Makefile.am
src/compositor.c

index a94128c..8b633f3 100644 (file)
@@ -32,7 +32,7 @@ weston_SOURCES =                              \
        weston-egl-ext.h
 
 git-version.h : .FORCE
-       echo "#define WESTON_SHA1 \"$(shell git --git-dir=$(top_srcdir)/.git show-ref --head --hash=20 HEAD)\"" > $@-new
+       echo "#define BUILD_ID \"$(shell git --work-tree=$(top_srcdir) describe --always --dirty) $(shell git --work-tree=$(top_srcdir) log -1 --format='%s (%ci)')\"" > $@-new
        cmp -s $@ $@-new || cp $@-new $@
        rm $@-new
 
index aa862cd..26c9a95 100644 (file)
@@ -3220,7 +3220,7 @@ int main(int argc, char *argv[])
                   STAMP_SPACE "Bug reports to: %s\n"
                   STAMP_SPACE "Build: %s\n",
                   PACKAGE_STRING, PACKAGE_URL, PACKAGE_BUGREPORT,
-                  WESTON_SHA1);
+                  BUILD_ID);
        log_uname();
 
        display = wl_display_create();