Skip to content

Commit d33576f

Browse files
committed
bpo-37936: Avoid ignoring files that we actually do track.
There were about 15 files that are actually in the repo but that are covered by the rules in .gitignore. Git itself takes no notice of what .gitignore says about files that it's already tracking... but the discrepancy can be confusing to a human that adds a new file unexpectedly covered by these rules, as well as to non-Git software that looks at .gitignore but doesn't implement this wrinkle in its semantics. (E.g., `rg`.) Several of these are from rules that apply more broadly than intended: for example, `Makefile` applies to `Doc/Makefile` and `Tools/freeze/test/Makefile`, whereas `/Makefile` means only the `Makefile` at the repo's root. The `Modules/Setup` rule simply wasn't updated after 961d54c. Finally, the `.gitignore` rule simply shouldn't be there at all. It didn't actually work as intended -- indeed the fact it showed up, in c5ae169, is exactly the thing it must have been intended to prevent ;-). (The Git feature that does address that use case is the `.git/info/exclude` file.)
1 parent 4101181 commit d33576f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Modules/python.exp
44
buildaix/
55
installp/
6-
.gitignore
76

87
# Two-trick pony for OSX and other case insensitive file systems:
98
# Ignore ./python binary on Unix but still look into ./Python/ directory.
@@ -33,12 +32,12 @@ Include/pydtrace_probes.h
3332
Lib/distutils/command/*.pdb
3433
Lib/lib2to3/*.pickle
3534
Lib/test/data/*
36-
Makefile
35+
!Lib/test/data/README
36+
/Makefile
3737
Makefile.pre
3838
Misc/python.pc
3939
Misc/python-embed.pc
4040
Misc/python-config.sh
41-
Modules/Setup
4241
Modules/Setup.config
4342
Modules/Setup.local
4443
Modules/config.c
@@ -85,6 +84,7 @@ config.log
8584
config.status
8685
config.status.lineno
8786
core
87+
!Tools/msi/core/
8888
db_home
8989
.hg/
9090
.idea/
@@ -95,7 +95,7 @@ libpython*.dylib
9595
libpython*.dll
9696
platform
9797
pybuilddir.txt
98-
pyconfig.h
98+
/pyconfig.h
9999
python-config
100100
python-config.py
101101
python.bat
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The :file:`.gitignore` file no longer applies to any files that are in fact
2+
tracked in the Git repository. Patch by Greg Price.

0 commit comments

Comments
 (0)