Re: What's cooking in git.git (Oct 2012, #01; Tue, 2)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 4, 2012, 06:01 UTC
- Message-ID
- <7v626q3hen.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CACsJy8CAGaEzGZBJq7pOW_2SDpRDLiPqJK0t2WjpuNqLU+yewQ@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 6 quoted lines
>> I am guessing that the only sensible definition is that "**" >> requires anything that comes before it (if exists) is at a proper >> hierarchy boundary, and anything matches it is also at a proper >> hierarchy boundary, so "x**y" matches "x/a/y" > > and "x/y" too? (As opposed to "x/**/y" which does not)
Yeah, x**y would match x/y under that "sensible" semantics.
Show 6 quoted lines
>> and not "xy", "xay", >> nor "xa/by" in the above example. If "x**y" can match "xy" or "xay" >> (or "**foo" can match "afoo"), it would be unreasonable to say it >> implies the pattern is anchored at any level, no? > > Yeah. That makes things easier to reason, though not exactly what we're having.
It sounds like that "x**y" with the code you imported would match "xy" and "xa/b/cy", and I do not think of a concise and good way to describe what it does to the end users.
"matches anything including '/'" is not a useful description for the purpose of allowing the user to intuitively understand why "x**y" is anchored at the level (or is not anchored and can appear anywhere).
Perhaps the wildmatch code may not be what we want X-<.