From: Nguyen Thai Ngoc Duy Date: Tue, 14 Dec 2010 15:04:36 GMT Subject: Re: [PATCH 12/19] tree_entry_interesting(): support wildcard matching Message-ID: In-Reply-To: <7vaak935ob.fsf@alter.siamese.dyndns.org> 2010/12/14 Junio C Hamano : > Nguyễn Thái Ngọc Duy   writes: > >> Signed-off-by: Nguyễn Thái Ngọc Duy >> --- >>  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. >> +             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