Re: [PATCH] exclude: fix a bug in prefix comparison optimization

2012-10-14 Thread Junio C Hamano
Nguyen Thai Ngoc Duy writes: > On Mon, Oct 15, 2012 at 12:36 AM, Junio C Hamano wrote: >> With your "teach attr.c match the same optimization as dir.c" >> series, you would need something like this >> >> diff --git i/attr.c w/attr.c >> index 6d39406..528e935 100644 >> --- i/attr.c >> +++ w/attr.

Re: [PATCH] exclude: fix a bug in prefix comparison optimization

2012-10-14 Thread Nguyen Thai Ngoc Duy
On Mon, Oct 15, 2012 at 12:36 AM, Junio C Hamano wrote: > With your "teach attr.c match the same optimization as dir.c" > series, you would need something like this > > diff --git i/attr.c w/attr.c > index 6d39406..528e935 100644 > --- i/attr.c > +++ w/attr.c > @@ -710,7 +710,7 @@ static int path_

Re: [PATCH] exclude: fix a bug in prefix comparison optimization

2012-10-14 Thread Junio C Hamano
Junio C Hamano writes: > Comparing the corresponding code in dir.c, there is no "compare the > literal prefix part with strcmp() before doing the fnmatch()" > optimization. Intended? > > (warning: I haven't had my caffeine yet) And it turns out that at the point I wrote the response, I still ha

Re: [PATCH] exclude: fix a bug in prefix comparison optimization

2012-10-14 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > When "namelen" becomes zero at this stage, we have matched the fixed > part, but whether it actually matches the pattern still depends on the > pattern in "exclude". As demonstrated in t3001, path "three/a.3" > exists and it matches the "three/a.3" part in pattern "

[PATCH] exclude: fix a bug in prefix comparison optimization

2012-10-14 Thread Nguyễn Thái Ngọc Duy
When "namelen" becomes zero at this stage, we have matched the fixed part, but whether it actually matches the pattern still depends on the pattern in "exclude". As demonstrated in t3001, path "three/a.3" exists and it matches the "three/a.3" part in pattern "three/a.3[abc]", but that does not mean