git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 15, 2012, 04:28 UTC
Message-ID
<7vk3usxssf.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8DEqkPob+KjFS_Y3BraS40CSP7snS3aB41hg0Ng0DuJDg@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 25 quoted lines
> On Mon, Oct 15, 2012 at 12:36 AM, Junio C Hamano <gitster@pobox.com> 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_matches(const char *pathname, int pathlen,
>>          * if the non-wildcard part is longer than the remaining
>>          * pathname, surely it cannot match.
>>          */
>> -       if (!namelen || prefix > namelen)
>> +       if (prefix > namelen)
>>                 return 0;
>>         if (baselen != 0)
>>                 baselen++;
>
> If there's still a chance to rewrite attr-match-optim-more series (I
> see it's in next now), then I could reorder the patches so that
> excluded_from_list code refactoring goes first, then rewrite "teach
> attr.c match... as dir.c" patch makes use of the new functions without
> code duplication. The end result would be the same, except that we
> won't see this bug in attr.c's history. Not much value so if it may
> take a lot of your time, don't bother.

Actually it started to become nuisance to deal with conflicts among as/check-ignore and the attr/dir/wildmatch series, and I've been wondering if it makes sense to eject all of these out of 'next' (as they won't advance beyond 'next' until the next release anyway).

So please go ahead and reroll the whole thing if you think the end result would be a history with better organization.

Previous: Nguyen Thai Ngoc Duy
Message 5 of 5 in “exclude: fix a bug in prefix comparison optimization”
  1. exclude: fix a bug in prefix comparison optimizationNguyễn Thái Ngọc Duy, Oct 14, 2012
  2. Junio C HamanoOct 14, 2012
  3. Junio C HamanoOct 14, 2012
  4. Nguyen Thai Ngoc DuyOct 15, 2012
  5. Junio C HamanoOct 15, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.