Re: [PATCH v2 1/1] pathspec: warn for a no-glob entry that contains `**`
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Mar 26, 2021, 01:32 UTC
- Message-ID
- <CAPig+cT3xprHLxDkvfgHpHY7t5_5_A2xyGKB5S2KiqW=3Lk-TQ@mail.gmail.com>
- In-Reply-To
- <xmqq35wiu4om.fsf@gitster.g>
On Thu, Mar 25, 2021 at 8:43 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> So, perhaps taking the first two paragraphs together and rewriting: > > When '/**/' appears in the pathspec, the user may be > expecting that it would be matched using the "wildmatch" > semantics, matching 0 or more directories. But that is > not what happens without ":(glob)" magic. > > Teach the pathspec parser to emit an advice message when a > substring "/**/" appears in a pathspec element that does not > have a ":(glob)" magic. Make sure we don't disturb users > who use ":(literal)" magic with such a substring, as it is > clear they want to find these strings literally.
I haven't been following the discussion, but is there a reason we need to penalize the user with a warning rather than helping, for instance by inferring ":(glob)" in the presence of `/**/` if not otherwise countermanded by ":(literal)" or whatnot?