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 gits...@pobox.com 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

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 pclo...@gmail.com 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' '

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. Adding

[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

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 pclo...@gmail.com 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

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

2012-10-10 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Nguyễn Thái Ngọc Duy pclo...@gmail.com 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 ||

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 gits...@pobox.com wrote: Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: @@ -690,16 +689,18 @@ static int path_matches(const char *pathname, int pathlen, * contain the trailing slash */ - if (pathlen baselen || +