[PATCH 2/4] dir.c::match_basename(): pay attention to the length of string parameters

2013-03-26 Thread Junio C Hamano
The function takes two counted strings (basename, basenamelen and pattern, patternlen) as parameters, together with prefix (the length of the prefix in pattern that is to be matched literally without globbing against the basename) and EXC_* flags that tells it how to match the pattern against the

Re: [PATCH 2/4] dir.c::match_basename(): pay attention to the length of string parameters

2013-03-26 Thread Jeff King
On Tue, Mar 26, 2013 at 11:39:29AM -0700, Junio C Hamano wrote: The function takes two counted strings (basename, basenamelen and pattern, patternlen) as parameters, together with prefix (the length of the prefix in pattern that is to be matched literally without globbing against the

Re: [PATCH 2/4] dir.c::match_basename(): pay attention to the length of string parameters

2013-03-26 Thread Jeff King
On Tue, Mar 26, 2013 at 02:55:59PM -0400, Jeff King wrote: * Otherwise, make sure we use only the counted part of the strings when calling fnmatch_icase(). Because these counted strings are full strings most of the time, avoid unnecessary allocation. I think this is OK, with the

Re: [PATCH 2/4] dir.c::match_basename(): pay attention to the length of string parameters

2013-03-26 Thread Junio C Hamano
Jeff King p...@peff.net writes: I timed this doing git archive HEAD on webkit.git before and after. It actually ended up not mattering much (I think because it is only the directories which are affected, not each individually path, so it's a much smaller number than you'd think). The

Re: [PATCH 2/4] dir.c::match_basename(): pay attention to the length of string parameters

2013-03-26 Thread Jeff King
On Tue, Mar 26, 2013 at 01:49:10PM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: I timed this doing git archive HEAD on webkit.git before and after. It actually ended up not mattering much (I think because it is only the directories which are affected, not each

Re: [PATCH 2/4] dir.c::match_basename(): pay attention to the length of string parameters

2013-03-26 Thread Junio C Hamano
Jeff King p...@peff.net writes: So I think your series is the right direction, but we would want to factor out the allocation code and use it from match_pathname, as well. I am deep into today's integration cycle, so perhaps in the meantime you can help with a follow-up patch ;-)? -- To

Re: [PATCH 2/4] dir.c::match_basename(): pay attention to the length of string parameters

2013-03-26 Thread Jeff King
On Tue, Mar 26, 2013 at 03:33:40PM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: So I think your series is the right direction, but we would want to factor out the allocation code and use it from match_pathname, as well. I am deep into today's integration cycle, so