Skip to content

Commit 9ae9ac1

Browse files
miss-islingtonzware
authored andcommitted
bpo-37936: Avoid ignoring files that we actually do track. (GH-15451) (GH-15748)
There were about 14 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. https://bugs.python.org/issue37936 (cherry picked from commit 5e5e951) Authored-by: Greg Price <[email protected]>
1 parent 58a7f80 commit 9ae9ac1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Include/pydtrace_probes.h
2727
Lib/distutils/command/*.pdb
2828
Lib/lib2to3/*.pickle
2929
Lib/test/data/*
30-
Makefile
30+
!Lib/test/data/README
31+
/Makefile
3132
Makefile.pre
3233
Misc/python.pc
3334
Misc/python-config.sh
@@ -77,6 +78,7 @@ config.log
7778
config.status
7879
config.status.lineno
7980
core
81+
!Tools/msi/core/
8082
db_home
8183
.hg/
8284
.idea/
@@ -87,7 +89,7 @@ libpython*.dylib
8789
libpython*.dll
8890
platform
8991
pybuilddir.txt
90-
pyconfig.h
92+
/pyconfig.h
9193
python-config
9294
python-config.py
9395
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)