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

Re: [PATCH] t/Makefile: make sure that file names are truly platform-independent

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 16, 2016, 08:42 UTC
Message-ID
<alpine.DEB.2.20.1608161035320.4924@virtualbox>
In-Reply-To
<alpine.DEB.2.20.1608161026110.4924@virtualbox>
Hi Junio,
On Tue, 16 Aug 2016, Johannes Schindelin wrote:
Show 17 quoted lines
> On Mon, 15 Aug 2016, Junio C Hamano wrote:
> 
> > Junio C Hamano <gitster@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.

Ciao, Dscho

Previous: Johannes SchindelinNext: Junio C Hamano
Message 11 of 17 in “t/Makefile: make sure that file names are truly platform-independent”
  1. t/Makefile: make sure that file names are truly platform-independentJohannes Schindelin, Aug 15, 2016
  2. Junio C HamanoAug 15, 2016
  3. Junio C HamanoAug 15, 2016
  4. Jeff KingAug 15, 2016
  5. Johannes SchindelinAug 16, 2016
  6. Jeff KingAug 16, 2016
  7. Johannes SchindelinAug 16, 2016
  8. Jeff KingAug 16, 2016
  9. Junio C HamanoAug 15, 2016
  10. Johannes SchindelinAug 16, 2016
  11. Johannes SchindelinAug 16, 2016
  12. Junio C HamanoAug 16, 2016
  13. Junio C HamanoAug 16, 2016
  14. Johannes SchindelinAug 16, 2016
  15. Johannes SixtAug 16, 2016
  16. t/Makefile: make sure that paths can be checked out on platforms we careJohannes Schindelin, Aug 16, 2016
  17. t/Makefile: ensure that paths are valid on platforms we careJohannes Schindelin, Aug 16, 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.