From: Michael Stapelberg Date: Wed, 2 Jun 2010 09:21:52 +0000 (+0200) Subject: Include git branch name in the version string X-Git-Tag: tree-pr1~194 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c1789bef8e3f2072b78ad565049fce27a59d71dd;p=i3%2Fi3 Include git branch name in the version string --- diff --git a/common.mk b/common.mk index 6887470f..00300cf8 100644 --- a/common.mk +++ b/common.mk @@ -7,7 +7,8 @@ SYSCONFDIR=/etc else SYSCONFDIR=$(PREFIX)/etc endif -GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1))" +# The escaping is absurd, but we need to escape for shell, sed, make, define +GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1), branch $(shell [ -f .git/HEAD ] && sed 's/ref: refs\/heads\/\(.*\)/\\\\\\"\1\\\\\\"/g' .git/HEAD || echo 'unknown'))" VERSION:=$(shell git describe --tags --abbrev=0) CFLAGS += -std=c99