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: 4.0~69 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f2148ffa0b41b875ca96dbcdddc09ef784fde8ec;p=i3%2Fi3 Include git branch name in the version string --- diff --git a/common.mk b/common.mk index 0334ac61..349da32f 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