[PATCH 1/1] building from git: use --abbrev=7 for version string
authorTomi Ollila <tomi.ollila@iki.fi>
Tue, 22 Apr 2014 15:19:44 +0000 (18:19 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:01:50 +0000 (10:01 -0800)
0e/5957a1c9e8709e36bc10606baf7a9fd9e051ab [new file with mode: 0644]

diff --git a/0e/5957a1c9e8709e36bc10606baf7a9fd9e051ab b/0e/5957a1c9e8709e36bc10606baf7a9fd9e051ab
new file mode 100644 (file)
index 0000000..24de5aa
--- /dev/null
@@ -0,0 +1,77 @@
+Return-Path: <too@guru-group.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 74C29431FBF\r
+       for <notmuch@notmuchmail.org>; Tue, 22 Apr 2014 08:19:58 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 2XUH7o8bf0-J for <notmuch@notmuchmail.org>;\r
+       Tue, 22 Apr 2014 08:19:53 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 956DC431FBD\r
+       for <notmuch@notmuchmail.org>; Tue, 22 Apr 2014 08:19:53 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id 847061000C0; Tue, 22 Apr 2014 18:19:46 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/1] building from git: use --abbrev=7 for version string\r
+Date: Tue, 22 Apr 2014 18:19:44 +0300\r
+Message-Id: <1398179984-29531-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+Cc: tomi.ollila@iki.fi\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 22 Apr 2014 15:19:58 -0000\r
+\r
+Users may have set core.abbrev=n, where n != 7 in their git config\r
+file(s) which would give them different than expected version strings\r
+when building notmuch from git. This fixes the commit hash part of\r
+version string to 7 hexadecimal values.\r
+---\r
+\r
+tested with:\r
+git config core.abbrev 12\r
+git describe\r
+rm version.stamp\r
+make\r
+cat version.stamp\r
+git reset --hard origin/master\r
+make\r
+cat version.stamp\r
+\r
+.local | 2 +-\r
+ 1 file changed, 1 insertion(+), 1 deletion(-)\r
+\r
+diff --git a/Makefile.local b/Makefile.local\r
+index 877a979..6e78368 100644\r
+--- a/Makefile.local\r
++++ b/Makefile.local\r
+@@ -21,7 +21,7 @@ endif\r
+ VERSION:=$(shell cat ${srcdir}/version)\r
+ ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),)\r
+ ifeq ($(IS_GIT),yes)\r
+-VERSION:=$(shell git describe --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)\r
++VERSION:=$(shell git describe --abbrev=7 --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)\r
+ # Write the file 'version.stamp' in case its contents differ from $(VERSION)\r
+ FILE_VERSION:=$(shell test -f version.stamp && read vs < version.stamp || vs=; echo $$vs)\r
+ ifneq ($(FILE_VERSION),$(VERSION))\r
+-- \r
+1.9.0\r
+\r