On Fri, Oct 5, 2012 at 2:01 PM, Johannes Sixt <j.s...@viscovery.net> wrote:
> Am 10/4/2012 9:39, schrieb Nguyễn Thái Ngọc Duy:
>> - - If the pattern does not contain a slash '/', git treats it as
>> -   a shell glob pattern and checks for a match against the
>> -   pathname relative to the location of the `.gitignore` file
>> -   (relative to the toplevel of the work tree if not from a
>> -   `.gitignore` file).
>> + - If the pattern does not contain a slash '/' nor '**', git
>> +   treats it as a shell glob pattern and checks for a match
>> +   against the pathname relative to the location of the
>> +   `.gitignore` file (relative to the toplevel of the work tree
>> +   if not from a `.gitignore` file).

I think in the latest round, we forbid this case (i.e. a/**, **/b and
a/**/b are ok, but a**b is not), exactly because it's hard to define
how it should do. Thanks for another example.

>> +test_expect_success '"**" with no slashes test' '
>> +     echo "a**f foo=bar" >.gitattributes &&
>> +     cat <<\EOF >expect &&
>> +f: foo: unspecified
>> +a/f: foo: bar
>> +a/b/f: foo: bar
>> +a/b/c/f: foo: bar
>> +EOF
>
> Should the above .gitattributes match nested paths, such as b/a/c/f?
>
> I think it should, because the user can easily say "/a**f" that nested
> paths should not be matched.

The user can also say **/a/**f to match b/a/c/f.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to