Re: Relative ls-files
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Mar 24, 2011, 13:26 UTC
- Message-ID
- <AANLkTinYB=ZUTe29Y9ibLVL5z3KhiYmnCpCGcHx=18RJ@mail.gmail.com>
- In-Reply-To
- <7vaaglcv9f.fsf@alter.siamese.dyndns.org>
On Thu, Mar 24, 2011 at 5:44 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> 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..
-- Duy