Re: [PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

2018-10-29 Thread Duy Nguyen
On Mon, Oct 29, 2018 at 2:24 PM Ævar Arnfjörð Bjarmason wrote: > This patch looks good to me, but I think it's a bad state of affairs to > keep changing these semantics and not having something like a > "gitwildmatch" doc were we document this matching syntax. While we don't have a separate

Re: [PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

2018-10-29 Thread Ævar Arnfjörð Bjarmason
On Sat, Oct 27 2018, Nguyễn Thái Ngọc Duy wrote: > In WM_PATHNAME mode (or FNM_PATHNAME), '*' does not match '/' and '**' > can but only in three patterns: > > - '**/' matches zero or more leading directories > - '/**/' matches zero or more directories in between > - '/**' matches zero or more

Re: [PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

2018-10-28 Thread Junio C Hamano
Duy Nguyen writes: >> Nice analyzes. >> I have one question here: >> If the user specifies '**' and nothing is found, >> would it be better to die() with a useful message >> instead of silently correcting it ? > > Consider the main use case of wildmatch, .gitignore patterns, dying > would be

Re: [PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

2018-10-28 Thread Duy Nguyen
On Sun, Oct 28, 2018 at 7:25 AM Torsten Bögershausen wrote: > > On Sat, Oct 27, 2018 at 10:48:23AM +0200, Nguyễn Thái Ngọc Duy wrote: > > In WM_PATHNAME mode (or FNM_PATHNAME), '*' does not match '/' and '**' > > can but only in three patterns: > > > > - '**/' matches zero or more leading

Re: [PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

2018-10-28 Thread Torsten Bögershausen
On Sat, Oct 27, 2018 at 10:48:23AM +0200, Nguyễn Thái Ngọc Duy wrote: > In WM_PATHNAME mode (or FNM_PATHNAME), '*' does not match '/' and '**' > can but only in three patterns: > > - '**/' matches zero or more leading directories > - '/**/' matches zero or more directories in between > - '/**'

[PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

2018-10-27 Thread Nguyễn Thái Ngọc Duy
In WM_PATHNAME mode (or FNM_PATHNAME), '*' does not match '/' and '**' can but only in three patterns: - '**/' matches zero or more leading directories - '/**/' matches zero or more directories in between - '/**' matches zero or more trailing directories/files When '**' is present but not in one