All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"SZEDER Gábor" <szeder.dev@gmail.com>,
	"Jeff King" <peff@peff.net>, "Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH v3 1/4] Makefile: strip leading ./ in $(LIB_H)
Date: Mon, 16 Sep 2019 12:23:08 -0700	[thread overview]
Message-ID: <e7fa5e1df76040c6e67727a4b33567a4b23a9aec.1568661443.git.liu.denton@gmail.com> (raw)
In-Reply-To: <cover.1568661443.git.liu.denton@gmail.com>

Currently, $(LIB_H) is generated from two modes: if `git ls-files` is
present, it will use that to enumerate the files in the repository; else
it will use `$(FIND) .` to enumerate the files in the directory.

There is a subtle difference between these two methods, however. With
ls-files, filenames don't have a leading `./` while with $(FIND), they
do. This results in $(CHK_HDRS) having to substitute out the leading
`./` before it uses $(LIB_H).

Unify the two possible values in $(LIB_H) by using patsubst to remove the
`./` prefix at its definition.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index ad71ae1219..ea77198247 100644
--- a/Makefile
+++ b/Makefile
@@ -818,12 +818,12 @@ VCSSVN_LIB = vcs-svn/lib.a
 
 GENERATED_H += command-list.h
 
-LIB_H := $(sort $(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
+LIB_H := $(sort $(patsubst ./%,%,$(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
 	$(FIND) . \
 	-name .git -prune -o \
 	-name t -prune -o \
 	-name Documentation -prune -o \
-	-name '*.h' -print))
+	-name '*.h' -print)))
 
 LIB_OBJS += abspath.o
 LIB_OBJS += advice.o
@@ -2769,7 +2769,7 @@ EXCEPT_HDRS := $(GEN_HDRS) compat/% xdiff/%
 ifndef GCRYPT_SHA256
 	EXCEPT_HDRS += sha256/gcrypt.h
 endif
-CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(patsubst ./%,%,$(LIB_H)))
+CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(LIB_H))
 HCO = $(patsubst %.h,%.hco,$(CHK_HDRS))
 
 $(HCO): %.hco: %.h FORCE
-- 
2.23.0


  reply	other threads:[~2019-09-16 19:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10  7:44 [PATCH 0/2] Makefile: run coccicheck on all non-upstream sources Denton Liu
2019-09-10  7:44 ` [PATCH 1/2] Makefile: define UPSTREAM_SOURCES Denton Liu
2019-09-10  7:44 ` [PATCH 2/2] Makefile: run coccicheck on more source files Denton Liu
2019-09-10 13:28   ` SZEDER Gábor
2019-09-10 16:07     ` Denton Liu
2019-09-10 14:18   ` SZEDER Gábor
2019-09-12 17:28 ` [PATCH v2 0/3] Makefile: run coccicheck on all non-upstream sources Denton Liu
2019-09-12 17:28   ` [PATCH v2 1/3] Makefile: define THIRD_PARTY_SOURCES Denton Liu
2019-09-12 21:42     ` Junio C Hamano
2019-09-12 17:28   ` [PATCH v2 2/3] Makefile: strip leading ./ in $(FIND_SOURCE_FILES) Denton Liu
2019-09-12 18:18     ` Junio C Hamano
2019-09-13 12:05     ` SZEDER Gábor
2019-09-12 17:28   ` [PATCH v2 3/3] Makefile: run coccicheck on more source files Denton Liu
2019-09-12 18:40     ` Junio C Hamano
2019-09-13 11:49       ` SZEDER Gábor
2019-09-13 17:14         ` Denton Liu
2019-09-13 18:00           ` SZEDER Gábor
2019-09-13 21:38             ` Denton Liu
2019-09-13 17:38         ` Junio C Hamano
2019-09-16 19:23   ` [PATCH v3 0/4] Makefile: run coccicheck on all non-upstream sources Denton Liu
2019-09-16 19:23     ` Denton Liu [this message]
2019-09-16 19:23     ` [PATCH v3 2/4] Makefile: define THIRD_PARTY_SOURCES Denton Liu
2019-09-16 20:56       ` Junio C Hamano
2019-09-16 22:00         ` [PATCH] fixup! " Denton Liu
2019-09-16 19:23     ` [PATCH v3 3/4] Makefile: strip leading ./ in $(FIND_SOURCE_FILES) Denton Liu
2019-09-16 19:23     ` [PATCH v3 4/4] Makefile: run coccicheck on more source files Denton Liu
2019-09-16 20:57     ` [PATCH v3 0/4] Makefile: run coccicheck on all non-upstream sources Junio C Hamano
2019-09-17  8:18       ` SZEDER Gábor
2019-09-17 16:13         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e7fa5e1df76040c6e67727a4b33567a4b23a9aec.1568661443.git.liu.denton@gmail.com \
    --to=liu.denton@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.