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