Re: [PATCH 12/19] tree_entry_interesting(): support wildcard matching
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Dec 14, 2010, 15:04 UTC
- Message-ID
- <AANLkTimwFw+ZjqKzbL0yNEC3Pw8RMW9Yr1KKpPFOOa4u@mail.gmail.com>
- In-Reply-To
- <7vaak935ob.fsf@alter.siamese.dyndns.org>
2010/12/14 Junio C Hamano <gitster@pobox.com>:
Show 9 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes: > >> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> >> --- >> tree-walk.c | 33 ++++++++++++++++++++++++++++++--- >> tree-walk.h | 2 +- >> 2 files changed, 31 insertions(+), 4 deletions(-) > > ;-) Looks almost too easy.
Much better, yes. I went the wrong way and allowed wildcards in directory matching too. It turned tree_entry_interesting() into hell.
Show 8 quoted lines
>> + never_interesting = 0;
>
> When we have wildcard we would want to disable the never-interesting
> optimization, but I wonder if doing so only when we do not have exact hit
> is what we want. If a sick person had a path "a?b" tracked, and asked to
> match a pathspec "a?b", don't we still want to say "'a?b' of course
> matches, but 'a1b' ('1' comes earlier than '?' in the sort order) and
> 'aAb' ('A' comes later) also match"?Heck, yeah. Easier for me though, just put this at top :-)
int never_interesting = ps->has_wildcard ? 0 : -1;
-- Duy