From f2148ffa0b41b875ca96dbcdddc09ef784fde8ec Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 2 Jun 2010 11:21:52 +0200 Subject: [PATCH] Include git branch name in the version string --- common.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.39.5