From: Jonas Fonseca Date: Sat, 20 May 2006 12:47:23 +0000 (+0200) Subject: Record builds with dirty working tree by appending -dirty to the version X-Git-Tag: tig-0.4~77 X-Git-Url: https://git.distorted.org.uk/~mdw/tig/commitdiff_plain/9074d9b648a57d65dbcfc4ba05b69ca437699329?hp=68b6e0eb4fb5becfdbc8be67b06c9bffc21bf04c Record builds with dirty working tree by appending -dirty to the version --- diff --git a/Makefile b/Makefile index 6eaffd4..78d47a4 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,9 @@ PROGS = tig DOCS = tig.1.txt tig.1.html tig.1 README.html ifneq (,$(wildcard .git)) -CFLAGS += '-DVERSION="$(shell git-describe)"' +VERSION = $(shell git-describe) +WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null) +CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"' endif all: $(PROGS)