git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 2/3] Makefile: strip leading ./ in $(FIND_SOURCE_FILES)

From
Denton Liu <liu.denton@gmail.com>
Date
Sep 12, 2019, 17:28 UTC
Message-ID
<239ffa690cc0bf65e2ee7fbdbb9c481499e37020.1568309119.git.liu.denton@gmail.com>
In-Reply-To
<cover.1568309119.git.liu.denton@gmail.com>

Currently, $(FIND_SOURCE_FILES) has 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 does not currently pose a problem but in a future patch, we will be using `filter-out` to process the list of files with the assumption that there is no prefix.

Unify the two possible invocations in $(FIND_SOURCE_FILES) by using sed to remove the `./` prefix in the $(FIND) case.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index b88b42d7ed..e2c693440b 100644
--- a/Makefile
+++ b/Makefile
@@ -2610,6 +2610,7 @@ FIND_SOURCE_FILES = ( \
 		-o \( -name 'trash*' -type d -prune \) \
 		-o \( -name '*.[hcS]' -type f -print \) \
 		-o \( -name '*.sh' -type f -print \) \
+		| sed -e 's|^\./||' \
 	)
 
 $(ETAGS_TARGET): FORCE
-- 
2.23.0.37.g745f681289
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 29 in “Makefile: run coccicheck on all non-upstream sources”
  1. 0/2 Makefile: run coccicheck on all non-upstream sourcesDenton Liu, Sep 10, 2019
  2. 1/2 Makefile: define UPSTREAM_SOURCESDenton Liu, Sep 10, 2019
  3. 2/2 Makefile: run coccicheck on more source filesDenton Liu, Sep 10, 2019
  4. SZEDER GáborSep 10, 2019
  5. Denton LiuSep 10, 2019
  6. SZEDER GáborSep 10, 2019
  7. 0/3 Makefile: run coccicheck on all non-upstream sourcesDenton Liu, Sep 12, 2019
  8. 1/3 Makefile: define THIRD_PARTY_SOURCESDenton Liu, Sep 12, 2019
  9. Junio C HamanoSep 12, 2019
  10. 2/3 Makefile: strip leading ./ in $(FIND_SOURCE_FILES)Denton Liu, Sep 12, 2019
  11. Junio C HamanoSep 12, 2019
  12. SZEDER GáborSep 13, 2019
  13. 3/3 Makefile: run coccicheck on more source filesDenton Liu, Sep 12, 2019
  14. Junio C HamanoSep 12, 2019
  15. SZEDER GáborSep 13, 2019
  16. Denton LiuSep 13, 2019
  17. SZEDER GáborSep 13, 2019
  18. Denton LiuSep 13, 2019
  19. Junio C HamanoSep 13, 2019
  20. 0/4 Makefile: run coccicheck on all non-upstream sourcesDenton Liu, Sep 16, 2019
  21. 1/4 Makefile: strip leading ./ in $(LIB_H)Denton Liu, Sep 16, 2019
  22. 2/4 Makefile: define THIRD_PARTY_SOURCESDenton Liu, Sep 16, 2019
  23. Junio C HamanoSep 16, 2019
  24. fixup! Makefile: define THIRD_PARTY_SOURCESDenton Liu, Sep 16, 2019
  25. 3/4 Makefile: strip leading ./ in $(FIND_SOURCE_FILES)Denton Liu, Sep 16, 2019
  26. 4/4 Makefile: run coccicheck on more source filesDenton Liu, Sep 16, 2019
  27. Junio C HamanoSep 16, 2019
  28. SZEDER GáborSep 17, 2019
  29. Junio C HamanoSep 17, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.