* [PATCH 1/3] Makefile.local: set IS_GIT = yes when regular file $srcdir/.git exists
@ 2016-05-25 21:04 Tomi Ollila
2016-05-25 21:04 ` [PATCH 2/3] Makefile.local: make IS_GIT simply expanded Tomi Ollila
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Tomi Ollila @ 2016-05-25 21:04 UTC (permalink / raw)
To: notmuch; +Cc: tomi.ollila
$srcdir/.git may also be file. E.g. `git worktree` creates .git file
while new working tree is populated.
---
This first patch is useful for developers/testers who use git worktree
to get accurate version information. rest are not in such a hurry
(to be tested, I'll have these in by build circle around).
Makefile.local | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.local b/Makefile.local
index 6b413420b8d9..a1e9578441a4 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -10,7 +10,7 @@
# repository), we let git append identification of the actual commit.
PACKAGE=notmuch
-IS_GIT=$(shell if [ -d ${srcdir}/.git ] ; then echo yes ; else echo no; fi)
+IS_GIT=$(shell if [ -d ${srcdir}/.git -o -f ${srcdir}/.git ] ; then echo yes ; else echo no; fi)
ifeq ($(IS_GIT),yes)
DATE:=$(shell git --git-dir=${srcdir}/.git log --date=short -1 --pretty=format:%cd)
--
2.8.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] Makefile.local: make IS_GIT simply expanded
2016-05-25 21:04 [PATCH 1/3] Makefile.local: set IS_GIT = yes when regular file $srcdir/.git exists Tomi Ollila
@ 2016-05-25 21:04 ` Tomi Ollila
2016-05-25 21:04 ` [PATCH 3/3] Makefile.local: use $(wildcard) to check existence of ${srcdir}/.git Tomi Ollila
2016-06-11 16:25 ` [PATCH 1/3] Makefile.local: set IS_GIT = yes when regular file $srcdir/.git exists David Bremner
2 siblings, 0 replies; 5+ messages in thread
From: Tomi Ollila @ 2016-05-25 21:04 UTC (permalink / raw)
To: notmuch; +Cc: tomi.ollila
By using ':=' while setting IS_GIT it is expanded to 'yes' or 'no' at
that point (and not every time when $(IS_GIT) is referenced).
---
Makefile.local | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.local b/Makefile.local
index a1e9578441a4..ee3cf18f5757 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -10,7 +10,7 @@
# repository), we let git append identification of the actual commit.
PACKAGE=notmuch
-IS_GIT=$(shell if [ -d ${srcdir}/.git -o -f ${srcdir}/.git ] ; then echo yes ; else echo no; fi)
+IS_GIT:=$(shell if [ -d ${srcdir}/.git -o -f ${srcdir}/.git ] ; then echo yes ; else echo no; fi)
ifeq ($(IS_GIT),yes)
DATE:=$(shell git --git-dir=${srcdir}/.git log --date=short -1 --pretty=format:%cd)
--
2.8.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] Makefile.local: use $(wildcard) to check existence of ${srcdir}/.git
2016-05-25 21:04 [PATCH 1/3] Makefile.local: set IS_GIT = yes when regular file $srcdir/.git exists Tomi Ollila
2016-05-25 21:04 ` [PATCH 2/3] Makefile.local: make IS_GIT simply expanded Tomi Ollila
@ 2016-05-25 21:04 ` Tomi Ollila
2016-06-11 16:25 ` [PATCH 1/3] Makefile.local: set IS_GIT = yes when regular file $srcdir/.git exists David Bremner
2 siblings, 0 replies; 5+ messages in thread
From: Tomi Ollila @ 2016-05-25 21:04 UTC (permalink / raw)
To: notmuch; +Cc: tomi.ollila
With this GNU Make construct one shell invocation can be skipped
and code looks shorter (narrower). This would now match to .git
being other file type than regular file or directory (or symlink
to those), but that is not a use case anyone should expect users
to do.
---
Makefile.local | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.local b/Makefile.local
index ee3cf18f5757..045549b54442 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -10,7 +10,7 @@
# repository), we let git append identification of the actual commit.
PACKAGE=notmuch
-IS_GIT:=$(shell if [ -d ${srcdir}/.git -o -f ${srcdir}/.git ] ; then echo yes ; else echo no; fi)
+IS_GIT:=$(if $(wildcard ${srcdir}/.git),yes,no)
ifeq ($(IS_GIT),yes)
DATE:=$(shell git --git-dir=${srcdir}/.git log --date=short -1 --pretty=format:%cd)
--
2.8.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] Makefile.local: set IS_GIT = yes when regular file $srcdir/.git exists
2016-05-25 21:04 [PATCH 1/3] Makefile.local: set IS_GIT = yes when regular file $srcdir/.git exists Tomi Ollila
2016-05-25 21:04 ` [PATCH 2/3] Makefile.local: make IS_GIT simply expanded Tomi Ollila
2016-05-25 21:04 ` [PATCH 3/3] Makefile.local: use $(wildcard) to check existence of ${srcdir}/.git Tomi Ollila
@ 2016-06-11 16:25 ` David Bremner
2016-09-04 11:21 ` David Bremner
2 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2016-06-11 16:25 UTC (permalink / raw)
To: Tomi Ollila, notmuch; +Cc: tomi.ollila
Tomi Ollila <tomi.ollila@iki.fi> writes:
> $srcdir/.git may also be file. E.g. `git worktree` creates .git file
> while new working tree is populated.
pushed the first patch only
d
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] Makefile.local: set IS_GIT = yes when regular file $srcdir/.git exists
2016-06-11 16:25 ` [PATCH 1/3] Makefile.local: set IS_GIT = yes when regular file $srcdir/.git exists David Bremner
@ 2016-09-04 11:21 ` David Bremner
0 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2016-09-04 11:21 UTC (permalink / raw)
To: Tomi Ollila, notmuch; +Cc: tomi.ollila
David Bremner <david@tethera.net> writes:
> Tomi Ollila <tomi.ollila@iki.fi> writes:
>
>> $srcdir/.git may also be file. E.g. `git worktree` creates .git file
>> while new working tree is populated.
>
> pushed the first patch only
>
Pushed the second two patches
d
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-09-04 11:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-25 21:04 [PATCH 1/3] Makefile.local: set IS_GIT = yes when regular file $srcdir/.git exists Tomi Ollila
2016-05-25 21:04 ` [PATCH 2/3] Makefile.local: make IS_GIT simply expanded Tomi Ollila
2016-05-25 21:04 ` [PATCH 3/3] Makefile.local: use $(wildcard) to check existence of ${srcdir}/.git Tomi Ollila
2016-06-11 16:25 ` [PATCH 1/3] Makefile.local: set IS_GIT = yes when regular file $srcdir/.git exists David Bremner
2016-09-04 11:21 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).