Commit 3236636
authored
fix: sdist.exclude takes precedence over .gitignore (#872)
Previously, sdist.exclude and the built-in EXCLUDE_LINES were prepended
to the list of .gitignore rules. However, a common pattern of using * to
exclude everything and then using !-rules to list what should be
included renders this feature useless.
This commit changes the behavior of each_unignored_file to sequentially
consider the following sets of independent rules:
1. Explicit inclusions
2. Explicit exclusions
3. Global exclusions from the .gitignore files
4. The built-in exclusions
5. Nested exclusions from .gitignore
Fixes #8711 parent cafc039 commit 3236636
1 file changed
+15
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
| 43 | + | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
54 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
66 | 72 | | |
67 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
| |||
0 commit comments