]>
Commit | Line | Data |
---|---|---|
0a29b90c FG |
1 | #!/bin/bash |
2 | set -eu -o pipefail | |
3 | ||
4 | git init -q | |
5 | git config core.autocrlf false | |
6 | git config core.ignorecase false | |
7 | ||
8 | while read -r pattern value; do | |
9 | echo "$pattern" "$value" | |
10 | echo "$pattern" > .gitignore | |
11 | echo "$value" | git check-ignore -vn --stdin 2>&1 || : | |
12 | done <<EOF >git-baseline.nmatch | |
13 | /*foo bam/barfoo/baz/bam | |
14 | /*foo bar/bam/barfoo/baz/bam | |
15 | foo foobaz | |
16 | */\' XXX/\' | |
17 | /*foo bar/foo | |
18 | /*foo bar/bazfoo | |
19 | foo*bar foo/baz/bar | |
20 | /*foo.txt hello/foo.txt | |
21 | bar/foo baz/bar/foo | |
22 | *hello.txt hello.txt-and-then-some | |
23 | *hello.txt goodbye.txt | |
24 | *some/path/to/hello.txt some/path/to/hello.txt-and-then-some | |
25 | *some/path/to/hello.txt some/other/path/to/hello.txt | |
26 | *some/path/to/hello.txt a/bigger/some/path/to/hello.txt | |
27 | abc?def abc/def | |
28 | a*b*c abcd | |
29 | abc*abc*abc abcabcabcabcabcabcabca | |
30 | a[0-9]b a_b | |
31 | a[!0-9]b a0b | |
32 | a[!0-9]b a9b | |
33 | [!-] - | |
34 | a[^0-9]b a0b | |
35 | a[^0-9]b a9b | |
36 | [^-] - | |
37 | {a,b} a | |
38 | {a,b} b | |
39 | {[}],foo} } | |
40 | {foo} foo | |
41 | {*.foo,*.bar,*.wat} test.foo | |
42 | {*.foo,*.bar,*.wat} test.bar | |
43 | {*.foo,*.bar,*.wat} test.wat | |
44 | abc*def abc/def | |
45 | aBcDeFg abcdefg | |
46 | aBcDeFg ABCDEFG | |
47 | aBcDeFg AbCdEfG | |
48 | some/**/needle.txt some/other/notthis.txt | |
49 | some/**/**/needle.txt some/other/notthis.txt | |
50 | /**/test one/notthis | |
51 | /**/test notthis | |
52 | **/.* ab.c | |
53 | **/.* abc/ab.c | |
54 | .*/** a.bc | |
55 | .*/** abc/a.bc | |
56 | ./foo foo | |
57 | **/foo foofoo | |
58 | **/foo/bar foofoo/bar | |
59 | /*.c mozilla-sha1/sha1.c | |
60 | **/m4/ltoptions.m4 csharp/src/packages/repositories.config | |
61 | some/*/needle.txt some/needle.txt | |
62 | some/*/needle.txt some/one/two/needle.txt | |
63 | some/*/needle.txt some/one/two/three/needle.txt | |
64 | .*/** .abc | |
65 | foo/** foo | |
66 | {**/src/**,foo} abc/src/bar | |
67 | {**/src/**,foo} foo | |
68 | abc[/]def abc/def | |
69 | EOF | |
70 | ||
71 | while read -r pattern value; do | |
72 | echo "$pattern" "$value" | |
73 | echo "$pattern" > .gitignore | |
74 | echo "$value" | git check-ignore -vn --stdin 2>&1 || : | |
75 | done <<EOF >git-baseline.match | |
76 | */' XXX/' | |
77 | \a a | |
78 | \\\[a-z] \a | |
79 | \\\? \a | |
80 | \\\* \\ | |
81 | /*foo.txt barfoo.txt | |
82 | *foo.txt bar/foo.txt | |
83 | *.c mozilla-sha1/sha1.c | |
84 | *.rs .rs | |
85 | *hello.txt hello.txt | |
86 | *hello.txt gareth_says_hello.txt | |
87 | *hello.txt some/path/to/hello.txt | |
88 | /*foo.txt foo.txt | |
89 | *hello.txt some\path\to\hello.txt | |
90 | *hello.txt an/absolute/path/to/hello.txt | |
91 | *some/path/to/hello.txt some/path/to/hello.txt | |
92 | a foo/a | |
93 | a a | |
94 | a*b a_b | |
95 | a*b*c abc | |
96 | a*b*c a_b_c | |
97 | a*b*c a___b___c | |
98 | abc*abc*abc abcabcabcabcabcabcabc | |
99 | a*a*a*a*a*a*a*a*a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
100 | a*b[xyz]c*d abxcdbxcddd | |
101 | ☃ ☃ | |
102 | ** abcde | |
103 | ** .asdf | |
104 | ** x/.asdf | |
105 | a[0-9]b a0b | |
106 | a[0-9]b a9b | |
107 | a[!0-9]b a_b | |
108 | [a-z123] 1 | |
109 | [1a-z23] 1 | |
110 | [123a-z] 1 | |
111 | [abc-] - | |
112 | [-abc] - | |
113 | [-a-c] b | |
114 | [a-c-] b | |
115 | [-] - | |
116 | a[^0-9]b a_b | |
117 | _[[]_[]]_[?]_[*]_!_ _[_]_?_*_!_ | |
118 | a,b a,b | |
119 | \[ [ | |
120 | \? ? | |
121 | \* * | |
122 | aBcDeFg aBcDeFg | |
123 | some/**/needle.txt some/needle.txt | |
124 | some/**/needle.txt some/one/needle.txt | |
125 | some/**/needle.txt some/one/two/needle.txt | |
126 | some/**/needle.txt some/other/needle.txt | |
127 | some/**/**/needle.txt some/needle.txt | |
128 | some/**/**/needle.txt some/one/needle.txt | |
129 | some/**/**/needle.txt some/one/two/needle.txt | |
130 | some/**/**/needle.txt some/other/needle.txt | |
131 | **/test one/two/test | |
132 | **/test one/test | |
133 | **/test test | |
134 | /**/test one/two/test | |
135 | /**/test one/test | |
136 | /**/test test | |
137 | **/.* .abc | |
138 | **/.* abc/.abc | |
139 | **/foo/bar foo/bar | |
140 | .*/** .abc/abc | |
141 | test/** test/ | |
142 | test/** test/one | |
143 | test/** test/one/two | |
144 | some/*/needle.txt some/one/needle.txt | |
145 | abc/def abc/def | |
146 | EOF | |
147 | ||
148 | git config core.ignorecase true | |
149 | while read -r pattern value; do | |
150 | echo "$pattern" "$value" | |
151 | echo "$pattern" > .gitignore | |
152 | echo "$value" | git check-ignore -vn --stdin 2>&1 || : | |
153 | done <<EOF >git-baseline.match-icase | |
154 | aBcDeFg aBcDeFg | |
155 | aBcDeFg abcdefg | |
156 | aBcDeFg ABCDEFG | |
157 | aBcDeFg AbCdEfG | |
158 | EOF |