]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Makefile: exclude test cruft from FIND_SOURCE_FILES
authorJeff King <peff@peff.net>
Wed, 14 Dec 2016 14:28:04 +0000 (09:28 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Dec 2016 17:54:49 +0000 (09:54 -0800)
The test directory may contain three types of files that
match our patterns:

  1. Helper programs in t/helper.

  2. Sample data files (e.g., t/t4051/hello.c).

  3. Untracked cruft in trash directories and t/perf/build.

We want to match (1), but not the other two, as they just
clutter up the list.

For the ls-files method, we can drop (2) with a negative
pathspec. We do not have to care about (3), since ls-files
will not list untracked files.

For `find`, we can match both cases with `-prune` patterns.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile

index f42b1953d8d66f882ae09bd97b7d0e12af88bf2b..001126931d0b770cb94e73461880aabf31a76eba 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2150,9 +2150,15 @@ 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 || \
+       git ls-files \
+               '*.[hcS]' \
+               ':!*[tp][0-9][0-9][0-9][0-9]*' \
+               2>/dev/null || \
        $(FIND) . \
                \( -name .git -type d -prune \) \
+               -o \( -name '[tp][0-9][0-9][0-9][0-9]' -type d -prune \) \
+               -o \( -name build -type d -prune \) \
+               -o \( -name 'trash*' -type d -prune \) \
                -o \( -name '*.[hcS]' -type f -print \) \
        )