Re: [PATCH v2 2/2] attr: more matching optimizations from .gitignore

2012-10-12 Thread Nguyen Thai Ngoc Duy
On Fri, Oct 12, 2012 at 12:09:57PM -0700, Junio C Hamano wrote: > This is not entirely your fault, but please don't do that "cd ..". > > The original test had "cd bare", made an assumption that step will > never fail (which is mostly correct), and ran everything afterward > in that subdirectory. >

Re: [PATCH v2 2/2] attr: more matching optimizations from .gitignore

2012-10-12 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh > index 51f3045..4a1402f 100755 > --- a/t/t0003-attributes.sh > +++ b/t/t0003-attributes.sh > @@ -242,4 +242,18 @@ test_expect_success 'bare repository: test > info/attributes' ' > attr_check subdir/

Re: [PATCH v2 2/2] attr: more matching optimizations from .gitignore

2012-10-12 Thread Nguyen Thai Ngoc Duy
On Thu, Oct 11, 2012 at 3:03 AM, Junio C Hamano wrote: > It would save time from both of us if you can check what is queued > on 'pu'. I do not think I touched the code for off-by-one bugs > there, though. 'pu' looks good. -- Duy -- To unsubscribe from this list: send the line "unsubscribe git"

Re: [PATCH v2 2/2] attr: more matching optimizations from .gitignore

2012-10-10 Thread Nguyen Thai Ngoc Duy
On Thu, Oct 11, 2012 at 4:41 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >>@@ -690,16 +689,18 @@ static int path_matches(const char *pathname, int >> pathlen, >>* contain the trailing slash >>*/ >> >>- if (pathlen < baselen || >>+ if (pathlen < basel

Re: [PATCH v2 2/2] attr: more matching optimizations from .gitignore

2012-10-10 Thread Junio C Hamano
Junio C Hamano writes: > Nguyễn Thái Ngọc Duy writes: > >>@@ -690,16 +689,18 @@ static int path_matches(const char *pathname, int >> pathlen, >> * contain the trailing slash >> */ >> >>- if (pathlen < baselen || >>+ if (pathlen < baselen + 1 || >> (baselen

Re: [PATCH v2 2/2] attr: more matching optimizations from .gitignore

2012-10-10 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: >@@ -690,16 +689,18 @@ static int path_matches(const char *pathname, int > pathlen, >* contain the trailing slash >*/ > >- if (pathlen < baselen || >+ if (pathlen < baselen + 1 || > (baselen && pathname[baselen] != '/') |

Re: [PATCH v2 2/2] attr: more matching optimizations from .gitignore

2012-10-10 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > .gitattributes and .gitignore share the same pattern syntax but has > separate matching implementation. Over the years, ignore's > implementation accumulates more optimizations while attr's stays the > same. > > This patch adds those optimizations to attr. Basically

[PATCH v2 2/2] attr: more matching optimizations from .gitignore

2012-10-10 Thread Nguyễn Thái Ngọc Duy
.gitattributes and .gitignore share the same pattern syntax but has separate matching implementation. Over the years, ignore's implementation accumulates more optimizations while attr's stays the same. This patch adds those optimizations to attr. Basically it tries to avoid fnmatch as much as poss