Thread (6 messages) flat view 6 messages, 6 authors, 2016-06-15

Re: What's cooking in git.git (Oct 2012, #01; Tue, 2)

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:54:56

On Wed, Oct 3, 2012 at 6:20 AM, Junio C Hamano [off-list ref] wrote:
* nd/wildmatch (2012-09-27) 5 commits
 - Support "**" in .gitignore and .gitattributes patterns using wildmatch()
 - Integrate wildmatch to git
 - compat/wildmatch: fix case-insensitive matching
 - compat/wildmatch: remove static variable force_lower_case
 - Import wildmatch from rsync

 Allows pathname patterns in .gitignore and .gitattributes files
 with double-asterisks "foo/**/bar" to match any number of directory
 hiearchies.

 It was pointed out that some symbols that do not have to be global
 are left global. I think this reroll fixed most of them.

 Will merge to 'next'.
Just a bit of finding lately, in case you want to postpone the merge.

There's an interesting case: "**foo". According to our rules, that
pattern does not contain slashes therefore is basename match. But some
might find that confusing because "**" can match slashes, as opposed
to ordinary wildcards which cannot. So we could either go with our
rules and consider "**" just like "*" in this case (do we need
document clarification?), or redefine it that the presence of "**"
implies FNM_PATHNAME.

I think the latter makes more sense. When users put "**" they expect
to match some slashes. But that may call for a refactoring in
path_matches() in attr.c. Putting strstr(pattern, "**") in that
matching function may increase overhead unnecessarily.

The third option is just die() and let users decide either "*foo",
"**/foo" or "/**foo", never "**foo".
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help