Re: [BUG] ls-files '**' globstar matches one or more directories instead of zero or more directories

2017-04-16 Thread Alistair Buxton
On IRC someone pointed me to the glossary section for pathspec, and I find that even more confusing. In the section about ":(glob)" it says: > For example, "**/foo" matches file or directory "foo" anywhere, the same as > pattern "foo". This is not true for ls-files: ":(glob)**/.gitignore" is

Re: [BUG] ls-files '**' globstar matches one or more directories instead of zero or more directories

2017-04-16 Thread Alistair Buxton
On 16 April 2017 at 12:25, Duy Nguyen wrote: > git ls-files ':(glob)**/*' > > Without that '**' is a normal '*' and matching just subdirs is expected. But '*/' should match exactly one subdirectory deep. Instead it matches one more more subdirectories. Meaning it behaves the

Re: [BUG] ls-files '**' globstar matches one or more directories instead of zero or more directories

2017-04-16 Thread Duy Nguyen
On Sat, Apr 15, 2017 at 2:17 AM, Alistair Buxton wrote: > To reproduce, go to any git repository and run: > > diff <(git ls-files '**/*' | sort) <(git ls-files | sort) Actually the '**/' magic only kicks in if you write git ls-files ':(glob)**/*' Without that '**' is

Re: [BUG] ls-files '**' globstar matches one or more directories instead of zero or more directories

2017-04-16 Thread Duy Nguyen
On Sat, Apr 15, 2017 at 2:17 AM, Alistair Buxton wrote: > To reproduce, go to any git repository and run: > > diff <(git ls-files '**/*' | sort) <(git ls-files | sort) > > Expected result: No output since both commands should produce identical > output. > > Actual

[BUG] ls-files '**' globstar matches one or more directories instead of zero or more directories

2017-04-14 Thread Alistair Buxton
To reproduce, go to any git repository and run: diff <(git ls-files '**/*' | sort) <(git ls-files | sort) Expected result: No output since both commands should produce identical output. Actual result: '**/*' only matches files at least one directory deep. The same happens with eg