{"thread":{"id":"42895","subject":"[PATCH] contrib/persistent-https: use Git version for build label","startedAt":"2016-07-21T01:00:25Z","lastAt":"2016-07-22T20:21:43Z","messageCount":3,"participants":["Parker Moore","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"291898","messageId":"CAOiOGAfWfEy60qg3AbbPNqkvJDMsXBHY8ZSXBCKJYha_gDB8mw@mail.gmail.com","threadId":"42895","inReplyTo":null,"subject":"[PATCH] contrib/persistent-https: use Git version for build label","fromName":"Parker Moore","fromEmail":"parkrmoore@gmail.com","sentAt":"2016-07-21T01:00:00Z","receivedAt":"2016-07-21T01:00:25Z","isPatch":true,"sender":{"key":"parkrmoore@gmail.com","avatar":"https://avatars.githubusercontent.com/u/237985?v=4"},"body":"From: Parker Moore <parkrmoore@gmail.com>\n\nThe previous method simply used the UNIX timestamp of when the binary was\nbuilt as its build label.\n\n    $ make && ./git-remote-persistent-http -print_label\n    1469061546\n\nThis patch aims to align the label for this binary with the Git version\ncontained in the GIT-VERSION-FILE. This gives a better sense of the version\nof the binary as it can be mapped to a particular revision or release of\nGit itself. For example:\n\n    $ make && ./git-remote-persistent-http -print_label\n    2.9.1.275.g75676c8\n\nDiscussion of this patch is available on a related thread in the mailing\nlist surrounding this package called \"contrib/persistent-https: update\nldflags syntax for Go 1.7+\". The gmane.org link is:\nhttp://article.gmane.org/gmane.comp.version-control.git/299653/\n\nSigned-off-by: Parker Moore <parkrmoore@gmail.com>\n---\n contrib/persistent-https/Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/persistent-https/Makefile\nb/contrib/persistent-https/Makefile\nindex 92baa3be..8248269 100644\n--- a/contrib/persistent-https/Makefile\n+++ b/contrib/persistent-https/Makefile\n@@ -12,7 +12,7 @@\n # See the License for the specific language governing permissions and\n # limitations under the License.\n\n-BUILD_LABEL=$(shell date +\"%s\")\n+BUILD_LABEL=$(shell cat ../../GIT-VERSION-FILE | cut -d\" \" -f3)\n TAR_OUT=$(shell go env GOOS)_$(shell go env GOARCH).tar.gz\n\n all: git-remote-persistent-https git-remote-persistent-https--proxy \\\n"},{"id":"291988","messageId":"xmqqwpkda71x.fsf@gitster.mtv.corp.google.com","threadId":"42895","inReplyTo":"CAOiOGAfWfEy60qg3AbbPNqkvJDMsXBHY8ZSXBCKJYha_gDB8mw@mail.gmail.com","subject":"Re: [PATCH] contrib/persistent-https: use Git version for build label","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-07-22T17:58:34Z","receivedAt":"2016-07-22T17:58:42Z","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> diff --git a/contrib/persistent-https/Makefile\n> b/contrib/persistent-https/Makefile\n> index 92baa3be..8248269 100644\n> --- a/contrib/persistent-https/Makefile\n> +++ b/contrib/persistent-https/Makefile\n> @@ -12,7 +12,7 @@\n>  # See the License for the specific language governing permissions and\n>  # limitations under the License.\n>\n> -BUILD_LABEL=$(shell date +\"%s\")\n> +BUILD_LABEL=$(shell cat ../../GIT-VERSION-FILE | cut -d\" \" -f3)\n\nWe tend to avoid catting a single file only to pipe the result into\na different command, so I'd rewrite this like so:\n\n    BUILD_LABEL=$(shell cut -d\" \" -f3 ../../GIT-VERSION-FILE)\n\nwhile queuing.\n\nThanks.\n"},{"id":"292013","messageId":"CAOiOGAdV0+bg+=RAFgJyWFmdzZpB6KabGMN8Z57KTqqos3aTfg@mail.gmail.com","threadId":"42895","inReplyTo":"xmqqwpkda71x.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] contrib/persistent-https: use Git version for build label","fromName":"Parker Moore","fromEmail":"parkrmoore@gmail.com","sentAt":"2016-07-22T20:21:36Z","receivedAt":"2016-07-22T20:21:43Z","isPatch":true,"sender":{"key":"parkrmoore@gmail.com","avatar":"https://avatars.githubusercontent.com/u/237985?v=4"},"body":"> We tend to avoid catting a single file only to pipe the result into a different command\n\nYou got it. Here's a new patch:\n\nFrom 432c0054a28a6c91b9fc1d9b53714061cb3d903c Mon Sep 17 00:00:00 2001\nFrom: Parker Moore <parkrmoore@gmail.com>\nDate: Wed, 20 Jul 2016 18:33:28 -0600\nSubject: [PATCH] contrib/persistent-https: use Git version for build label\n\nThe previous method simply used the UNIX timestamp of when the binary was\nbuilt as its build label.\n\n    $ make && ./git-remote-persistent-http -print_label\n    1469061546\n\nThis patch aims to align the label for this binary with the Git version\ncontained in the GIT-VERSION-FILE. This gives a better sense of the version\nof the binary as it can be mapped to a particular revision or release of\nGit itself. For example:\n\n    $ make && ./git-remote-persistent-http -print_label\n    2.9.1.275.g75676c8\n\nDiscussion of this patch is available on a related thread in the mailing\nlist surrounding this package called \"contrib/persistent-https: update\nldflags syntax for Go 1.7+\". The gmane.org link is:\nhttp://article.gmane.org/gmane.comp.version-control.git/299653/\n\nSigned-off-by: Parker Moore <parkrmoore@gmail.com>\n---\n contrib/persistent-https/Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/persistent-https/Makefile\nb/contrib/persistent-https/Makefile\nindex 92baa3b..9da1779 100644\n--- a/contrib/persistent-https/Makefile\n+++ b/contrib/persistent-https/Makefile\n@@ -12,7 +12,7 @@\n # See the License for the specific language governing permissions and\n # limitations under the License.\n\n-BUILD_LABEL=$(shell date +\"%s\")\n+BUILD_LABEL=$(shell cut -d\" \" -f3 ../../GIT-VERSION-FILE)\n TAR_OUT=$(shell go env GOOS)_$(shell go env GOARCH).tar.gz\n\n all: git-remote-persistent-https git-remote-persistent-https--proxy \\\n-- \n2.9.2\n"}]}