1 Return-Path: <m.walters@qmul.ac.uk>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 15FDC431FBD
\r
6 for <notmuch@notmuchmail.org>; Sun, 26 Jan 2014 11:58:15 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5
\r
12 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,
\r
13 NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id ORnaaEApaEfC for <notmuch@notmuchmail.org>;
\r
17 Sun, 26 Jan 2014 11:58:07 -0800 (PST)
\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 50BE9431FBC
\r
22 for <notmuch@notmuchmail.org>; Sun, 26 Jan 2014 11:58:07 -0800 (PST)
\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])
\r
24 by mail2.qmul.ac.uk with esmtp (Exim 4.71)
\r
25 (envelope-from <m.walters@qmul.ac.uk>)
\r
26 id 1W7VqC-0002c4-2g; Sun, 26 Jan 2014 19:58:05 +0000
\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)
\r
28 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)
\r
29 (envelope-from <m.walters@qmul.ac.uk>)
\r
30 id 1W7Vp3-0004aN-LL; Sun, 26 Jan 2014 19:56:49 +0000
\r
31 From: Mark Walters <markwalters1009@gmail.com>
\r
32 To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
\r
33 Subject: Re: [PATCH 1/1] build: write VERSION file containing $(VERSION)
\r
35 In-Reply-To: <1390689800-16654-1-git-send-email-tomi.ollila@iki.fi>
\r
36 References: <1390689800-16654-1-git-send-email-tomi.ollila@iki.fi>
\r
37 User-Agent: Notmuch/0.15.2+484~gfb59956 (http://notmuchmail.org) Emacs/23.4.1
\r
38 (x86_64-pc-linux-gnu)
\r
39 Date: Sun, 26 Jan 2014 19:55:08 +0000
\r
40 Message-ID: <87wqhm8qn7.fsf@qmul.ac.uk>
\r
42 Content-Type: text/plain; charset=us-ascii
\r
43 X-Sender-Host-Address: 93.97.24.31
\r
44 X-QM-Geographic: According to ripencc,
\r
45 this message was delivered by a machine in Britain (UK) (GB).
\r
46 X-QM-SPAM-Info: Sender has good ham record. :)
\r
47 X-QM-Body-MD5: c23e237f691b26f710ce5f7bc11d8048 (of first 20000 bytes)
\r
48 X-SpamAssassin-Score: 0.0
\r
49 X-SpamAssassin-SpamBar: /
\r
50 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
52 spam. We require at least 5.0 points to mark a message as spam.
\r
53 This message scored 0.0 points. Summary of the scoring:
\r
54 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
55 provider * (markwalters1009[at]gmail.com)
\r
56 * 0.0 AWL AWL: From: address is in the auto white-list
\r
57 X-QM-Scan-Virus: ClamAV says the message is clean
\r
58 Cc: tomi.ollila@iki.fi
\r
59 X-BeenThere: notmuch@notmuchmail.org
\r
60 X-Mailman-Version: 2.1.13
\r
62 List-Id: "Use and development of the notmuch mail system."
\r
63 <notmuch.notmuchmail.org>
\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
65 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
67 List-Post: <mailto:notmuch@notmuchmail.org>
\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
71 X-List-Received-Date: Sun, 26 Jan 2014 19:58:15 -0000
\r
76 I experimented with this and it didn't always seem to rebuild VERSION
\r
77 when it should. Looking at the file .git/HEAD that just seems to be the
\r
78 branch name not the commit id (unless in detached HEAD state)
\r
81 http://stackoverflow.com/questions/6526451/how-to-include-git-commit-number-into-a-c-executable
\r
82 suggests adding .git/index to the VERSION depends.
\r
84 I tested that and that does seem to work. It may mean that VERSION gets
\r
85 rebuilt if you stash (for example) but that is probably not a big
\r
92 On Sat, 25 Jan 2014, Tomi Ollila <tomi.ollila@iki.fi> wrote:
\r
93 > This version file will be as prerequisite to the target files
\r
94 > that use the version info for some purpose, like printing
\r
95 > it to the user to examine. The contents of the VERSION file
\r
96 > is seldom read by the build system itself as the $(VERSION)
\r
97 > variable has the same information.
\r
99 > Makefile.local | 11 ++++++++++-
\r
100 > 1 file changed, 10 insertions(+), 1 deletion(-)
\r
102 > diff --git a/Makefile.local b/Makefile.local
\r
103 > index c85e09c..1f876b3 100644
\r
104 > --- a/Makefile.local
\r
105 > +++ b/Makefile.local
\r
106 > @@ -22,6 +22,8 @@ VERSION:=$(shell cat ${srcdir}/version)
\r
107 > ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),)
\r
108 > ifeq ($(IS_GIT),yes)
\r
109 > VERSION:=$(shell git describe --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
\r
110 > +# Make the 'VERSION' file depend *also* on .git/HEAD in this case
\r
111 > +VERSION: .git/HEAD
\r
115 > @@ -69,6 +71,11 @@ ifeq ($(shell cat .first-build-message 2>/dev/null),)
\r
119 > +# This VERSION file is used mostly for triggering other file remakes...
\r
120 > +# This may get other dependency to .git/HEAD above in this file.
\r
121 > +VERSION: version
\r
122 > + echo $(VERSION) > $@
\r
125 > if git tag -v $(VERSION) >/dev/null 2>&1; then \
\r
126 > ref=$(VERSION); \
\r
127 > @@ -280,6 +287,8 @@ notmuch_client_srcs = \
\r
129 > notmuch_client_modules = $(notmuch_client_srcs:.c=.o)
\r
131 > +notmuch.o: VERSION
\r
133 > notmuch: $(notmuch_client_modules) lib/libnotmuch.a util/libutil.a parse-time-string/libparse-time-string.a
\r
134 > $(call quiet,CXX $(CFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -o $@
\r
136 > @@ -318,7 +327,7 @@ install-desktop:
\r
137 > desktop-file-install --mode 0644 --dir "$(DESTDIR)$(desktop_dir)" notmuch.desktop
\r
139 > SRCS := $(SRCS) $(notmuch_client_srcs)
\r
140 > -CLEAN := $(CLEAN) notmuch notmuch-shared $(notmuch_client_modules) notmuch.elc
\r
141 > +CLEAN := $(CLEAN) VERSION notmuch notmuch-shared $(notmuch_client_modules)
\r
143 > DISTCLEAN := $(DISTCLEAN) .first-build-message Makefile.config
\r
148 > _______________________________________________
\r
149 > notmuch mailing list
\r
150 > notmuch@notmuchmail.org
\r
151 > http://notmuchmail.org/mailman/listinfo/notmuch
\r