Re: [PATCH 5/6] gitignore: do not do basename match with patterns that have '**'

2012-10-05 Thread Nguyen Thai Ngoc Duy
On Fri, Oct 5, 2012 at 2:01 PM, Johannes Sixt wrote: > Am 10/4/2012 9:39, schrieb Nguyễn Thái Ngọc Duy: >> - - If the pattern does not contain a slash '/', git treats it as >> - a shell glob pattern and checks for a match against the >> - pathname relative to the location of the `.gitignore` f

Re: [PATCH 5/6] gitignore: do not do basename match with patterns that have '**'

2012-10-05 Thread Johannes Sixt
Am 10/4/2012 9:39, schrieb Nguyễn Thái Ngọc Duy: > - - If the pattern does not contain a slash '/', git treats it as > - a shell glob pattern and checks for a match against the > - pathname relative to the location of the `.gitignore` file > - (relative to the toplevel of the work tree if not

Re: [PATCH 5/6] gitignore: do not do basename match with patterns that have '**'

2012-10-04 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > - if (!strchr(p, '/')) > + if (!strchr(p, '/') && !strstr(p, "**")) Doesn't wildmatch allow these to be quoted, similar to the way usual glob works, e.g. $ >ff $ >\?f $ echo ?? ?f ff $ echo \?f

[PATCH 5/6] gitignore: do not do basename match with patterns that have '**'

2012-10-04 Thread Nguyễn Thái Ngọc Duy
"**" can match slashes, not like "*". "ab**ef" should be able to match "ab/cd/ef", or "ab/c/d/ef" and so on. Turn off the EXC_FLAG_NODIR in this case otherwise the pattern is only checked against the base name. This behavior is in sync with rsync. Signed-off-by: Nguyễn Thái Ngọc Duy --- Document