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

2016-08-16 Thread Johannes Sixt
Am 16.08.2016 um 10:42 schrieb Johannes Schindelin: That only leaves the conclusion that some of our pathspec code tries to be helpful and takes a backslash for a directory separator. Very true. The code that does this is in prefix_filename():

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

2016-08-16 Thread Jeff King
On Tue, Aug 16, 2016 at 05:37:35PM +0200, Johannes Schindelin wrote: > > Hrm. I am not sure I agree. At GitHub, for instance, we turn on > > core.protectNTFS for all repositories because we do want to be a vector > > for attacks. > > I trust you meant "do *not* want to be a vector for

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

2016-08-16 Thread Johannes Schindelin
Hi Peff, On Tue, 16 Aug 2016, Jeff King wrote: > On Tue, Aug 16, 2016 at 03:10:46PM +0200, Johannes Schindelin wrote: > > > > I am not convinced this mechanism needs to be built into git. > > > Because it happens to be about filenames, git at least has a hope of > > > making sense of the

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

2016-08-16 Thread Johannes Schindelin
Hi Junio, On Tue, 16 Aug 2016, Junio C Hamano wrote: > Junio C Hamano writes: > > > The trick to catch non-ascii depends on core.quotepath set to true > > (which is the default). You would need to run ls-files with an > > explicit "-c core.quotepath=false" to be safe. > >

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

2016-08-16 Thread Jeff King
On Tue, Aug 16, 2016 at 03:10:46PM +0200, Johannes Schindelin wrote: > > I am not convinced this mechanism needs to be built into git. Because it > > happens to be about filenames, git at least has a hope of making sense > > of the various project rules. > > Both of you gentle people may recall

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

2016-08-16 Thread Johannes Schindelin
Hi Peff & Junio, On Mon, 15 Aug 2016, Jeff King wrote: > On Mon, Aug 15, 2016 at 09:57:52AM -0700, Junio C Hamano wrote: > > > I wonder if we already have a good mechanism to allow a project and > > its participants (say, "me") to declare "in this project, pathnames > > must conform to this

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

2016-08-16 Thread Junio C Hamano
Junio C Hamano writes: > The trick to catch non-ascii depends on core.quotepath set to true > (which is the default). You would need to run ls-files with an > explicit "-c core.quotepath=false" to be safe. > ... > The invocation of "git -c core.quotepath=false ls-files" needs

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

2016-08-16 Thread Junio C Hamano
Johannes Schindelin writes: >> > > 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

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

2016-08-16 Thread Johannes Schindelin
Hi Junio, On Tue, 16 Aug 2016, Johannes Schindelin wrote: > On Mon, 15 Aug 2016, Junio C Hamano wrote: > > > Junio C Hamano writes: > > > > >> +test-lint-filenames: > > >> +@illegal="$$(git ls-files | grep '["*:<>?\\|]')"; \ > > > > > > This pattern must exclude

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

2016-08-16 Thread Johannes Schindelin
Hi Junio, On Mon, 15 Aug 2016, Junio C Hamano wrote: > Junio C Hamano 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

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

2016-08-15 Thread Junio C Hamano
Junio C Hamano writes: > Good thinking. > > Some tests may have to be skipped on platforms that cannot express > certain paths, but even then they shouldn't ship a file with > pathname that cannot even be checked out (they should instead create > and use such a path, protected

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

2016-08-15 Thread Jeff King
On Mon, Aug 15, 2016 at 09:57:52AM -0700, Junio C Hamano wrote: > I wonder if we already have a good mechanism to allow a project and > its participants (say, "me") to declare "in this project, pathnames > must conform to this rule" and help them avoid creating a tree that > violates the rule

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

2016-08-15 Thread Junio C Hamano
Junio C Hamano writes: > Johannes Schindelin writes: > >> 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

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

2016-08-15 Thread Junio C Hamano
Johannes Schindelin writes: > 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. Good

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

2016-08-15 Thread Johannes Schindelin
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: