Re: What's cooking in git.git (Oct 2012, #01; Tue, 2)
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Oct 4, 2012, 11:46 UTC
- Message-ID
- <CACsJy8DUmjwrkDTePr_8zAU_gcm1kh11J4NVWANMXKsqA6Pb1A@mail.gmail.com>
- In-Reply-To
- <506D5837.6020708@alum.mit.edu>
On Thu, Oct 4, 2012 at 4:34 PM, Michael Haggerty <mhagger@alum.mit.edu> wrote: On Thu, Oct 4, 2012 at 4:34 PM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
Show 5 quoted lines
> Given that there is no obvious interpretation for what a construct like > "x**y" would mean, and many plausible guesses (most of which sound > rather useless), I suggest that we forbid it. This will make the > feature easier to explain and make .gitignore files that use it easier > to understand.
Yep, sounds like a good short term plan.
> As for the implementation, it is quite easy to textually convert a glob > pattern, including "**" parts, into a regexp.
Or we could introduce regexp syntax as an alternative and let users choose (and pay associated price). Patterns starting with // are never matched (we don't normalize paths in .gitignore). Any patterns started with "//regex:" is followed by regex. Reject all other // patterns for future use.
Show 7 quoted lines
> _filename_char_pattern = r'[^/]'
> _glob_patterns = [
> ('?', _filename_char_pattern),
> ('/**', r'(/.+)?'),
> ('**/', r'(.+/)?'),
> ('*', _filename_char_pattern + r'*'),
> ]I don't fully understand the rest (never been a big fan of python) but what about bracket expressions like [!abc] and [:alnum:]?
-- Duy