All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3 01/10] wildmatch: fix "**" special case
Date: Thu, 24 Jan 2013 20:55:50 -0800	[thread overview]
Message-ID: <7vip6l7tex.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CACsJy8Bq8aQ69twWtwHyNzez2OwTN1wHxqHwb_AM-Qo4TUuv8Q@mail.gmail.com> (Duy Nguyen's message of "Fri, 25 Jan 2013 08:46:37 +0700")

Duy Nguyen <pclouds@gmail.com> writes:

> On Fri, Jan 25, 2013 at 1:22 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Duy Nguyen <pclouds@gmail.com> writes:
>>
>>> I don't think we need to support two different sets of wildcards in
>>> the long run. I'm thinking of adding ":(glob)" with WM_PATHNAME.
>>> Pathspec without :(glob) still uses the current wildcards (i.e. no
>>> FNM_PATHNAME). At some point, like 2.0, we either switch the behavior
>>> of patterns-without-:(glob) to WM_PATHNAME, or just disable wildcards
>>> when :(glob) is not present.
>>
>> Yeah, I think that is sensible.
>>
>> I am meaning to merge your retire-fnmatch topic to 'master'.
>
> I thought you wanted it to stay in 'next' longer :-)

I only said "a bit longer than other topics", and the topic has been
cooking on 'next' for three weeks by now, which is a lot longer.  I
haven't been keeping exact tallies, but trivial ones graduate from
'next' to 'master' in 3 to 5 days, ones with medium complexity in 7
to 10 days on average, I think.

> That looks ok. You may want to mention that "**" syntax is enabled in
> .gitignore and .gitattributes as well (even without USE_WILDMATCH).

Yeah, I forgot about that behaviour, and it is a bit confusing
story.  You did that in 237ec6e (Support "**" wildcard in .gitignore
and .gitattributes, 2012-10-15).

c41244e (wildmatch: support "no FNM_PATHNAME" mode, 2013-01-01) that
is part of the retire-fnmatch topic, changes the behaviour of
wildmatch() with respect to /**/ magic drastically, but everything
cancels out in the end:

 - With the current master without nd/retire-fnmatch, wildmatch()
   always works in WM_PATHNAME mode wrt '/**/'; match_pathname()
   that is used for attr/ignore matching uses wildmatch() so a
   pattern "**/Makefile" matches "Makefile" at the top, affected by
   the "**/" magic;

 - After merging nd/retire-fnmatch, wildmatch() needs WM_PATHNAME
   passed in order to grok '/**/' magic, but match_pathname() is
   changed in the same commit to pass WM_PATHNAME, so the "**/"
   magic is retained for ignore/attr matching.

> We
> could even stop the behavior change in for-each-ref (FNM_PATHNAME in
> general) but I guess because it's a nice regression, nobody would
> complain.

That is not a "regression" (whose definition is "we inadvertently
changed the behaviour and fixed that once, but the breakage came
back").  It is a behaviour change that is backward incompatible.

I would agree that it is a nice behaviour change, though ;-)

Thanks.
 

  reply	other threads:[~2013-01-25  4:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-01  2:44 [PATCH v3 00/10] fnmatch replacement Nguyễn Thái Ngọc Duy
2013-01-01  2:44 ` [PATCH v3 01/10] wildmatch: fix "**" special case Nguyễn Thái Ngọc Duy
2013-01-22 21:36   ` Junio C Hamano
2013-01-22 22:51     ` Junio C Hamano
2013-01-23  1:04       ` Duy Nguyen
2013-01-24  4:49         ` Junio C Hamano
2013-01-24  5:51           ` Duy Nguyen
2013-01-24 18:22             ` Junio C Hamano
2013-01-25  1:46               ` Duy Nguyen
2013-01-25  4:55                 ` Junio C Hamano [this message]
2013-01-01  2:44 ` [PATCH v3 02/10] compat/fnmatch: respect NO_FNMATCH* even on glibc Nguyễn Thái Ngọc Duy
2013-01-01  2:44 ` [PATCH v3 03/10] wildmatch: replace variable 'special' with better named ones Nguyễn Thái Ngọc Duy
2013-01-01  2:44 ` [PATCH v3 04/10] wildmatch: rename constants and update prototype Nguyễn Thái Ngọc Duy
2013-01-01  2:44 ` [PATCH v3 05/10] wildmatch: make dowild() take arbitrary flags Nguyễn Thái Ngọc Duy
2013-01-01  2:44 ` [PATCH v3 06/10] wildmatch: support "no FNM_PATHNAME" mode Nguyễn Thái Ngọc Duy
2013-01-01  2:44 ` [PATCH v3 07/10] test-wildmatch: add "perf" command to compare wildmatch and fnmatch Nguyễn Thái Ngọc Duy
2013-01-01  2:44 ` [PATCH v3 08/10] wildmatch: make a special case for "*/" with FNM_PATHNAME Nguyễn Thái Ngọc Duy
2013-01-01  2:44 ` [PATCH v3 09/10] wildmatch: advance faster in <asterisk> + <literal> patterns Nguyễn Thái Ngọc Duy
2013-01-01  2:44 ` [PATCH v3 10/10] Makefile: add USE_WILDMATCH to use wildmatch as fnmatch Nguyễn Thái Ngọc Duy

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=7vip6l7tex.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.