From 24b20099aa3c464cc1f3cb245e82bd836a69c877 Mon Sep 17 00:00:00 2001 From: Alessandro Arzilli Date: Fri, 28 Apr 2017 19:14:33 +0200 Subject: [PATCH] makefile: use git's $Id$ instead of setting ver.Build in makefile (#807) --- .gitattributes | 1 + Makefile | 5 +---- pkg/version/version.go | 5 ++++- 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..f147e8c5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +pkg/version/version.go ident diff --git a/Makefile b/Makefile index fda10bac..a4183d2e 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,10 @@ UNAME=$(shell uname) PREFIX=github.com/derekparker/delve GOVERSION=$(shell go version) -BUILD_SHA=$(shell git rev-parse HEAD) LLDB_SERVER=$(shell which lldb-server) ifeq "$(UNAME)" "Darwin" - BUILD_FLAGS=-ldflags="-s -X main.Build=$(BUILD_SHA)" -else - BUILD_FLAGS=-ldflags="-X main.Build=$(BUILD_SHA)" + BUILD_FLAGS=-ldflags="-s" endif # Workaround for GO15VENDOREXPERIMENT bug (https://github.com/golang/go/issues/11659) diff --git a/pkg/version/version.go b/pkg/version/version.go index 1339e33c..cb38b2c8 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -13,7 +13,10 @@ type Version struct { var ( // DelveVersion is the current version of Delve. - DelveVersion = Version{Major: "0", Minor: "12", Patch: "2", Metadata: ""} + DelveVersion = Version{ + Major: "0", Minor: "12", Patch: "2", Metadata: "", + Build: "$Id$", + } ) func (v Version) String() string {