[PATCH/RFC] attr: allow pattern escape using backslash

2012-11-11 Thread Nguyễn Thái Ngọc Duy
.gitattributes pattern syntax is supposed to be the same as .gitignore (except a few things that do not make sense in attr context, but that's a different issue). .gitignore uses fnmatch() as the matching machinery and \ is accepted as an escape code. In theory the pattern 'foo\ bar' should match

[PATCH/RFC] attr: allow pattern escape using backslash

2012-10-06 Thread Nguyễn Thái Ngọc Duy
.gitattributes pattern syntax is supposed to be the same as .gitignore (except a few things that do not make sense in attr context, but that's a different issue). .gitignore uses fnmatch() as the matching machinery and \ is accepted as an escape code. In theory the pattern 'foo\ bar' should match

Re: [PATCH/RFC] attr: allow pattern escape using backslash

2012-10-06 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: .gitattributes pattern syntax is supposed to be the same as .gitignore (except a few things that do not make sense in attr context, but that's a different issue). .gitignore uses fnmatch() as the matching machinery and \ is accepted as an escape

Re: [PATCH/RFC] attr: allow pattern escape using backslash

2012-10-06 Thread Nguyen Thai Ngoc Duy
On Sat, Oct 6, 2012 at 2:54 PM, Junio C Hamano gits...@pobox.com wrote: Shouldn't we do the same for quoting fnmatch(3) metacharacters? To match a path component 'a' followed by an asterisk followed by 'b', you could then write 'a\*b'. Same for quoting the backslash itself. I think my patch