git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] exclude: fix a bug in prefix comparison optimization
Date: Mon, 15 Oct 2012 11:09:26 +0700	[thread overview]
Message-ID: <CACsJy8DEqkPob+KjFS_Y3BraS40CSP7snS3aB41hg0Ng0DuJDg@mail.gmail.com> (raw)
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:
> 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

  parent reply	other threads:[~2012-10-15  4:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-14 11:35 [PATCH] exclude: fix a bug in prefix comparison optimization Nguyễn Thái Ngọc Duy
2012-10-14 17:36 ` Junio C Hamano
2012-10-14 18:25   ` Junio C Hamano
2012-10-15  4:09   ` Nguyen Thai Ngoc Duy [this message]
2012-10-15  4:28     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACsJy8DEqkPob+KjFS_Y3BraS40CSP7snS3aB41hg0Ng0DuJDg@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).