{"thread":{"id":"42894","subject":"[PATCH] contrib/persistent-https: update ldflags syntax for Go 1.7+","startedAt":"2016-07-21T00:59:04Z","lastAt":"2016-07-22T17:56:18Z","messageCount":2,"participants":["Parker Moore","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"291897","messageId":"CAOiOGAePh6syq8XMWdzE_H8UQxzpgnsCsiYx-TG+mg46FRgXKQ@mail.gmail.com","threadId":"42894","inReplyTo":null,"subject":"[PATCH] contrib/persistent-https: update ldflags syntax for Go 1.7+","fromName":"Parker Moore","fromEmail":"parkrmoore@gmail.com","sentAt":"2016-07-21T00:58:57Z","receivedAt":"2016-07-21T00:59:04Z","isPatch":true,"sender":{"key":"parkrmoore@gmail.com","avatar":"https://avatars.githubusercontent.com/u/237985?v=4"},"body":"From: Parker Moore <parkrmoore@gmail.com>\n\nThis fixes contrib/persistent-https builds for Go v1.7+ and is\ncompatible with Go v1.0+.\n\nRunning `make all` in `contrib/persistent-https` results in a failure\non Go 1.7 and above.\n\nSpecifically, the error is:\n\n    go build -o git-remote-persistent-https \\\n   -ldflags \"-X main._BUILD_EMBED_LABEL 1468613136\"\n    # _/Users/parkr/github/git/contrib/persistent-https\n    /usr/local/Cellar/go/1.7rc1/libexec/pkg/tool/darwin_amd64/link: -X\nflag requires argument of the form importpath.name=value\n    make: *** [git-remote-persistent-https] Error 2\n\nThis `name=value` syntax for the -X flag was introduced in Go v1.5\n(released Aug 19, 2015):\n\n- release notes: https://golang.org/doc/go1.5#link\n- commit: https://github.com/golang/go/commit/12795c02f3d6fc54ece09a86e70aaa40a94d5131\n\nIn Go v1.7, support for the old syntax was removed:\n\n- release notes: https://tip.golang.org/doc/go1.7#compiler\n- commit: https://github.com/golang/go/commit/51b624e6a29b135ce0fadb22b678acf4998ff16f\n\nThis patch includes the `=` to fix builds with Go v1.7+.\n\nThanks-to: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Parker Moore <parkrmoore@gmail.com>\n---\n contrib/persistent-https/Makefile | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/persistent-https/Makefile\nb/contrib/persistent-https/Makefile\nindex 92baa3be..2b4173d 100644\n--- a/contrib/persistent-https/Makefile\n+++ b/contrib/persistent-https/Makefile\n@@ -25,8 +25,10 @@ git-remote-persistent-http: git-remote-persistent-https\n        ln -f -s git-remote-persistent-https git-remote-persistent-http\n\n git-remote-persistent-https:\n+       case $$(go version) in \\\n+               \"go version go\"1.[0-5].*) EQ=\" \" ;; *) EQ=\"=\" ;; esac && \\\n        go build -o git-remote-persistent-https \\\n-               -ldflags \"-X main._BUILD_EMBED_LABEL $(BUILD_LABEL)\"\n+               -ldflags \"-X main._BUILD_EMBED_LABEL$${EQ}$(BUILD_LABEL)\"\n\n clean:\n        rm -f git-remote-persistent-http* *.tar.gz\n"},{"id":"291987","messageId":"xmqq1t2lblqp.fsf@gitster.mtv.corp.google.com","threadId":"42894","inReplyTo":"CAOiOGAePh6syq8XMWdzE_H8UQxzpgnsCsiYx-TG+mg46FRgXKQ@mail.gmail.com","subject":"Re: [PATCH] contrib/persistent-https: update ldflags syntax for Go 1.7+","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-07-22T17:55:58Z","receivedAt":"2016-07-22T17:56:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Parker Moore <parkrmoore@gmail.com> writes:\n\n> From: Parker Moore <parkrmoore@gmail.com>\n>\n> This fixes contrib/persistent-https builds for Go v1.7+ and is\n> compatible with Go v1.0+.\n\nThanks, applied.\n"}]}