Re: [PATCH v2 6/6] exclude: filter patterns by directory level

2013-03-10 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: A non-basename pattern that does not contain /**/ can't match anything outside the attached directory. Record its directory level and avoid matching unless the pathname is also at the same directory level. Without defining what a directory level

Re: [PATCH v2 6/6] exclude: filter patterns by directory level

2013-03-10 Thread Duy Nguyen
On Sun, Mar 10, 2013 at 3:20 PM, Junio C Hamano gits...@pobox.com wrote: + else if (*p == '/') + dirs--; I presume this is to compensate for a pattern like /pat whose leading slash is only to anchor the pattern at the level. Correct? Yes. Also for the record, we could cut

Re: [PATCH v2 6/6] exclude: filter patterns by directory level

2013-03-10 Thread Duy Nguyen
On Sun, Mar 10, 2013 at 5:58 PM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: A non-basename pattern that does not contain /**/ can't match anything outside the attached directory. Record its directory level