Some file names that are okay on ext4 and on HFS+ are illegal in
Windows. In order to stay truly platform-independent, Git's source code
must not contain such illegal file names, even if things just happen to
work on Linux.

One such file name was recently introduced into Git's `pu` branch:


It is illegal because it contains the '>' character that is not part of
a valid filename on Windows.

To catch these issues early, let's introduce a new test-lint-* goal that
fails if such file names were detected and run it as part of a `make

Signed-off-by: Johannes Schindelin <>
Fetch-It-Via: git fetch test-lint-filenames-v1

        This is the more complete fix I talked about.

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

diff --git a/t/Makefile b/t/Makefile
index 18e2b28..3c0eb48 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: 5e18482599a6cfeb8d4e0ee5a98d30220cbdff72
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