Some pathnames that are okay on ext4 and on HFS+ cannot be checked
out on Windows. Tests that want to see operations on such paths on
filesystems that support them must do so behind appropriate test
prerequisites, and must not include them in the source tree (instead
they should create them when they run). Otherwise, the source tree
cannot even be checked out.

Make sure that double-quotes, asterisk, colon, greater/less-than,
question-mark, backslash, tab, vertical-bar, as well as any non-ASCII
characters above 0x7f never appear in the pathnames with a new
test-lint-* target as part of a `make test`.

Noticed when a topic wanted to add a pathname with '>' in it.  A
check like this will prevent a similar problems from happening in the

Signed-off-by: Johannes Schindelin <>

        I re-munged the commit message (I saw that you munged it in `pu`
        and did not quite like the wording, so I permitted myself the

        And of course I tested this, and it does *not* list all files in
        subdirectories of t/ as problematic.

Fetch-It-Via: git fetch test-lint-filenames-v2
Interdiff vs v1:

 diff --git a/t/Makefile b/t/Makefile
 index 3c0eb48..bf9cad9 100644
 --- a/t/Makefile
 +++ b/t/Makefile
 @@ -69,7 +69,7 @@ test-lint-shell-syntax:
        @'$(PERL_PATH_SQ)' $(T) $(THELPERS)
 -      @illegal="$$(git ls-files | grep '["*:<>?\\|]')"; \
 +      @illegal="$$(git ls-files | grep '[     "*:<>?\\|]')"; \
                test -z "$$illegal" || { \
                echo >&2 "illegal file name(s): " $$illegal; exit 1; }

 t/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/t/Makefile b/t/Makefile
index 18e2b28..bf9cad9 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -52,7 +52,8 @@ clean-except-prove-cache:
 clean: clean-except-prove-cache
        $(RM) .prove
-test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax
+test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
+       test-lint-filenames
        @dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
@@ -67,6 +68,11 @@ test-lint-executable:
        @'$(PERL_PATH_SQ)' $(T) $(THELPERS)
+       @illegal="$$(git ls-files | grep '[     "*:<>?\\|]')"; \
+               test -z "$$illegal" || { \
+               echo >&2 "illegal file name(s): " $$illegal; exit 1; }
 aggregate-results-and-cleanup: $(T)
        $(MAKE) aggregate-results
        $(MAKE) clean

base-commit: 70dce4aee55ad8a39a53f86f37a4bd400e0cac7d
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to