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

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

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Oct 15, 2012, 04:09 UTC
Message-ID
<CACsJy8DEqkPob+KjFS_Y3BraS40CSP7snS3aB41hg0Ng0DuJDg@mail.gmail.com>
In-Reply-To
<7v8vb9yn09.fsf@alter.siamese.dyndns.org>
On Mon, Oct 15, 2012 at 12:36 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> 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. -- Duy

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 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.