Hi Junio,

On Tue, 16 Aug 2016, Johannes Schindelin wrote:

> On Mon, 15 Aug 2016, Junio C Hamano wrote:
> > Junio C Hamano <gits...@pobox.com> writes:
> > 
> > >> +test-lint-filenames:
> > >> +        @illegal="$$(git ls-files | grep '["*:<>?\\|]')"; \
> > >
> > > This pattern must exclude questionables on either NTFS or HFS+; it
> > > is ironic that it is not even sufficient to limit ourselves to the
> > > Portable Character Set [*1*], but such is life.
> > >
> > > By the way, doesn't ls-files take pathspec glob, saving one extra
> > > process to run grep?
> I specifically did not do that, sorry for omitting the rationale from the
> commit message. The reason why I have that grep is so that the backslash
> can also catch non-ASCII characters, such as "Hellö-Jüniö".

And there is another very good reason to keep the grep: the problem I just
reported is *caused* by your avoiding the grep call.

In my tests, at least, `git ls-files '*\*' lists *all* files in
subdirectories. In other words, it matches the *forward* slash. This also
happens when I run the command in cmd.exe instead of Git Bash, meaning
that it is *not* caused by some MSYS2 path conversion from pseudo-Unix to
Windows paths. That only leaves the conclusion that some of our pathspec
code tries to be helpful and takes a backslash for a directory separator.

In light of these problems, and also in light of the fact that the
test-lint-filenames code is hardly performance critical, I am strongly in
favor of reverting to using grep.


Reply via email to