Code

Record builds with dirty working tree by appending -dirty to the version
authorJonas Fonseca <fonseca@diku.dk>
Sat, 20 May 2006 12:47:23 +0000 (14:47 +0200)
committerJonas Fonseca <fonseca@antimatter.localdomain>
Sat, 20 May 2006 12:47:23 +0000 (14:47 +0200)
Makefile

index 6eaffd4634c2e5988f41685a95ebf8f24b6eae3d..78d47a48354e78887ac72139a4d9a7777e4d1b1b 100644 (file)
--- 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)