Re: [PATCH] build: check .git directory existence in srcdir (for out-of-tree builds)
[notmuch-archives.git] / 0d / a0be1695184081fa8c50183ff71109b3d0648c
1 Return-Path: <tomi.ollila@iki.fi>\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 AA64A431FBD\r
6         for <notmuch@notmuchmail.org>; Sun,  6 Jul 2014 12:50:43 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id abej6oNs7c5Q for <notmuch@notmuchmail.org>;\r
16         Sun,  6 Jul 2014 12:50:35 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 9EAF0431FAF\r
19         for <notmuch@notmuchmail.org>; Sun,  6 Jul 2014 12:50:35 -0700 (PDT)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id 289DB10008F;\r
22         Sun,  6 Jul 2014 22:50:26 +0300 (EEST)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH] build: check .git directory existence in srcdir (for\r
26         out-of-tree builds)\r
27 In-Reply-To: <874mywroni.fsf@maritornes.cs.unb.ca>\r
28 References: <1399404928-15471-1-git-send-email-tomi.ollila@iki.fi>\r
29         <874mywroni.fsf@maritornes.cs.unb.ca>\r
30 User-Agent: Notmuch/0.18.1+25~gdaf4b6f (http://notmuchmail.org) Emacs/24.3.1\r
31         (x86_64-unknown-linux-gnu)\r
32 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
33         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
34         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
35 Date: Sun, 06 Jul 2014 22:50:25 +0300\r
36 Message-ID: <m2fvieferi.fsf@guru.guru-group.fi>\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Sun, 06 Jul 2014 19:50:43 -0000\r
52 \r
53 On Sat, Jul 05 2014, David Bremner <david@tethera.net> wrote:\r
54 \r
55 > Tomi Ollila <tomi.ollila@iki.fi> writes:\r
56 >\r
57 >> So that $(VERSION) and version.stamp uses the git-describe -based\r
58 >> version data instead of the content of `version' file.\r
59 >>\r
60 >> For consistency also the git commands in Makefile[.local] target\r
61 >> `verify-no-dirty-code' uses the git --git-dir=$srcdir/.git ...\r
62 >> commands (inside ifeq($(IS_GIT),yes)). Attempting to make this\r
63 >> target outside of the tree will fail in any case.\r
64 >\r
65 > This seems to work OK; I wondered if an alternate method of setting (and\r
66 > exporting) GIT_DIR from the top level makefile would work as well, and\r
67 > be less intrusive?\r
68 \r
69 This looked like a good idea, and I tested it. But -- lo and behold --\r
70 the environment variables set in Makefile do not probagate to the\r
71 commands executed with $(shell ...) -- see (*) (I wrapped git(1) in a shell\r
72 script (executes env then execs real git) to verify this is still the case).\r
73 \r
74 I thoght now a bit whether we'd use variable in place of ${srcdir}/.git\r
75 but IMHO is better in this way:\r
76 \r
77    - make does not have option to warn/die in case variable undefined,\r
78      it is then just empty string so no internal error checking there\r
79 \r
80    - any human observer notices from the ${srcdir}/.git that we're not\r
81      using git from any nonstandard place -- if there were variable one\r
82      would have needed to dereference that to figure out this is the case.\r
83 \r
84 (*) http://www.cmcrossroads.com/article/basics-getting-environment-variables-gnu-make?page=0%2C1\r
85 \r
86 >\r
87 > d\r
88 \r
89 \r
90 Tomi\r