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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16 April 2017 at 12:25, Duy Nguyen <pclouds@xxxxxxxxx> 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 way '**/*/' should.

Try the following in the git source repo:

    shopt -s globstar
    diff <(ls -1 */.gitignore | sort) <(git ls-files '*/.gitignore' | sort)
    diff <(ls -1 */**/.gitignore | sort) <(git ls-files '*/.gitignore' | sort)

of course it works as expected if you say the magic word:

    diff <(ls -1 */.gitignore | sort) <(git ls-files
':(glob)*/.gitignore' | sort)


-- 
Alistair Buxton
a.j.buxton@xxxxxxxxx



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]