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

[PATCH 1/4] Makefile: reformat FIND_SOURCE_FILES

From
Jeff King <peff@peff.net>
Date
Dec 14, 2016, 14:26 UTC
Message-ID
<20161214142655.boepotpgwgrdnldz@sigill.intra.peff.net>
In-Reply-To
<20161214142533.svktxk63eiwaaeor@sigill.intra.peff.net>

As we add to this in future commits, the formatting is going to make it harder and harder to read. Let's write it more as we would in a shell script, putting each logical block on its own line.

Signed-off-by: Jeff King <peff@peff.net>
---
Just to make the other patches easier to read; no behavior change
intended.

I was tempted to actually pull this out into its own find-source-files.sh script. I don't know if that is preferable or not; it certainly makes the "make tags" output less ugly.

 Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index f53fcc90d..f42b1953d 100644
--- a/Makefile
+++ b/Makefile
@@ -2149,9 +2149,12 @@ endif
 po/build/locale/%/LC_MESSAGES/git.mo: po/%.po
 	$(QUIET_MSGFMT)mkdir -p $(dir $@) && $(MSGFMT) -o $@ $<
 
-FIND_SOURCE_FILES = ( git ls-files '*.[hcS]' 2>/dev/null || \
-			$(FIND) . \( -name .git -type d -prune \) \
-				-o \( -name '*.[hcS]' -type f -print \) )
+FIND_SOURCE_FILES = ( \
+	git ls-files '*.[hcS]' 2>/dev/null || \
+	$(FIND) . \
+		\( -name .git -type d -prune \) \
+		-o \( -name '*.[hcS]' -type f -print \) \
+	)
 
 $(ETAGS_TARGET): FORCE
 	$(RM) $(ETAGS_TARGET)
-- 
2.11.0.341.g202cd3142
Previous: Jeff KingNext: Jeff King
Message 2 of 5 in “"make tags" improvements”
  1. 0/4 "make tags" improvementsJeff King, Dec 14, 2016
  2. 1/4 Makefile: reformat FIND_SOURCE_FILESJeff King, Dec 14, 2016
  3. 2/4 Makefile: exclude test cruft from FIND_SOURCE_FILESJeff King, Dec 14, 2016
  4. 3/4 Makefile: match shell scripts in FIND_SOURCE_FILESJeff King, Dec 14, 2016
  5. 4/4 Makefile: exclude contrib from FIND_SOURCE_FILESJeff King, Dec 14, 2016

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.