From: Junio C Hamano Date: Thu, 24 Mar 2011 14:47:14 GMT Subject: Re: Relative ls-files Message-ID: <7v7hboa83x.fsf@alter.siamese.dyndns.org> In-Reply-To: Nguyen Thai Ngoc Duy writes: > On Thu, Mar 24, 2011 at 5:44 AM, Junio C Hamano wrote: >> Wouldn't it be more sensible to add a bit ("is this a glob or are we >> expected to match it literally") to each element in the pathspec array, >> and pass a pathspec whose elements are all marked as "literal" down from >> ls-tree? >> >> The internal matcher (and traversal optimizer) would need to become aware >> of "not a glob" match (and possibly different kinds of matches like "**/" >> support) sooner or later, and when that happens you would need something >> like the above on the caller side in ls-tree. > > I think it's possible even now. fnmatch() is only used if > pathspec_item.has_wildcard is true. So ls-tree.c only needs to clear > this field for all pathspecs and they will be treated literally. Let > me try.. Thanks, that would be good.