Implementing dirty git checkout indicator

This commit is contained in:
Shawn Siefkas 2013-04-02 09:38:08 -05:00
parent e566b89a5f
commit 5471f5b2ee
1 changed files with 4 additions and 1 deletions

View File

@ -10,7 +10,10 @@ ifeq ($(VERBOSE), 1)
GO_OPTIONS += -v
endif
BUILD_OPTIONS = -ldflags "-X main.GIT_COMMIT `git rev-parse --short HEAD`"
GIT_COMMIT = $(shell git rev-parse --short HEAD)
GIT_STATUS = $(shell test -n "`git status --porcelain`" && echo "+CHANGES")
BUILD_OPTIONS = -ldflags "-X main.GIT_COMMIT $(GIT_COMMIT)$(GIT_STATUS)"
SRC_DIR := $(GOPATH)/src