Re: [PATCH 3/4] pathspec: apply "*.c" optimization from exclude

2012-11-20 Thread Junio C Hamano
Nguyen Thai Ngoc Duy writes: >> When you come to strcmp(), you see that string_len is 1, pattern_len >> is 3, and pattern is "oob". string+string_len-pattern_len = "oob", >> one past the beginning of the original string "foob". They match. >> >> Oops? > > Oops indead. I'll need to check exclude

Re: [PATCH 3/4] pathspec: apply "*.c" optimization from exclude

2012-11-20 Thread Nguyen Thai Ngoc Duy
On Tue, Nov 20, 2012 at 4:20 AM, Junio C Hamano wrote: >> $ time git rev-list --quiet HEAD -- '*.c' >> >> real0m40.770s >> user0m40.290s >> sys 0m0.256s >> >> With the patch >> >> $ time ~/w/git/git rev-list --quiet HEAD -- '*.c' >> >> real0m34.288s >> user0m33.997s >> sys

Re: [PATCH 3/4] pathspec: apply "*.c" optimization from exclude

2012-11-19 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > -O2 build on linux-2.6, without the patch: Before the result, can you briefly explain what '"*.c" optimization from exclude' the title talks about is? When a pattern contains only a single asterisk, e.g. "foo*bar", after literally comparing the leading pa

[PATCH 3/4] pathspec: apply "*.c" optimization from exclude

2012-11-18 Thread Nguyễn Thái Ngọc Duy
-O2 build on linux-2.6, without the patch: $ time git rev-list --quiet HEAD -- '*.c' real0m40.770s user0m40.290s sys 0m0.256s With the patch $ time ~/w/git/git rev-list --quiet HEAD -- '*.c' real0m34.288s user0m33.997s sys 0m0.205s The above command is not supposed to