[Python-checkins] bpo-37936: Avoid ignoring files that we actually do track. (GH-15451) (GH-15748)

Zachary Ware webhook-mailer at python.org
Mon Sep 9 09:10:26 EDT 2019


https://github.com/python/cpython/commit/9ae9ac1061c76d637ebe9c1d6c6c802311d6ddba
commit: 9ae9ac1061c76d637ebe9c1d6c6c802311d6ddba
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Zachary Ware <zachary.ware at gmail.com>
date: 2019-09-09T08:10:19-05:00
summary:

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 5e5e9515029f70836003a8cfb30433166fcc8db7)

Authored-by: Greg Price <gnprice at gmail.com>

files:
A Misc/NEWS.d/next/Build/2019-08-24-00-29-40.bpo-37936.QrORqA.rst
M .gitignore

diff --git a/.gitignore b/.gitignore
index cdfe476088a8..6ebf6247f672 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,7 +27,8 @@ Include/pydtrace_probes.h
 Lib/distutils/command/*.pdb
 Lib/lib2to3/*.pickle
 Lib/test/data/*
-Makefile
+!Lib/test/data/README
+/Makefile
 Makefile.pre
 Misc/python.pc
 Misc/python-config.sh
@@ -77,6 +78,7 @@ config.log
 config.status
 config.status.lineno
 core
+!Tools/msi/core/
 db_home
 .hg/
 .idea/
@@ -87,7 +89,7 @@ libpython*.dylib
 libpython*.dll
 platform
 pybuilddir.txt
-pyconfig.h
+/pyconfig.h
 python-config
 python-config.py
 python.bat
diff --git a/Misc/NEWS.d/next/Build/2019-08-24-00-29-40.bpo-37936.QrORqA.rst b/Misc/NEWS.d/next/Build/2019-08-24-00-29-40.bpo-37936.QrORqA.rst
new file mode 100644
index 000000000000..4c6486103881
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2019-08-24-00-29-40.bpo-37936.QrORqA.rst
@@ -0,0 +1,2 @@
+The :file:`.gitignore` file no longer applies to any files that are in fact
+tracked in the Git repository.  Patch by Greg Price.



More information about the Python-checkins mailing list