cpython/Misc
Zachary Ware df935b5f0b
[3.8] bpo-37936: Systematically distinguish rooted vs. unrooted in .gitignore (GH-15823) (GH-15900)
A root cause of bpo-37936 is that it's easy to write a .gitignore
rule that's intended to apply to a specific file (e.g., the
`pyconfig.h` generated by `./configure`) but actually applies to all
similarly-named files in the tree (e.g., `PC/pyconfig.h`.)

Specifically, any rule with no non-trailing slashes is applied in an
"unrooted" way, to files anywhere in the tree.  This means that if we
write the rules in the most obvious-looking way, then

 * for specific files we want to ignore that happen to be in
   subdirectories (like `Modules/config.c`), the rule will work
   as intended, staying "rooted" to the top of the tree; but

 * when a specific file we want to ignore happens to be at the root of
   the repo (like `platform`), then the obvious rule (`platform`) will
   apply much more broadly than intended: if someone tries to add a
   file or directory named `platform` somewhere else in the tree, it
   will unexpectedly get ignored.

That's surprising behavior that can make the .gitignore file's
behavior feel finicky and unpredictable.

To avoid it, we can simply always give a rule "rooted" behavior when
that's what's intended, by systematically using leading slashes.

Further, to help make the pattern obvious when looking at the file and
minimize any need for thinking about the syntax when adding new rules:
separate the rules into one group for each type, with brief comments
identifying them.

For most of these rules it's clear whether they're meant to be rooted
or unrooted, but in a handful of cases I've only guessed.  In that
case the safer default (the choice that won't hide information) is the
narrower, rooted meaning, with a leading slash.  If for some of these
the unrooted meaning is desired after all, it'll be easy to move them
to the unrooted section at the top.

(cherry picked from commit 455122a009)

Co-authored-by: Greg Price <gnprice@gmail.com>
2019-09-11 11:31:12 +01:00
..
NEWS.d [3.8] bpo-37936: Systematically distinguish rooted vs. unrooted in .gitignore (GH-15823) (GH-15900) 2019-09-11 11:31:12 +01:00
ACKS bpo-36324: Apply review comments from Allen Downey (GH-15693) (GH-15694) 2019-09-05 00:42:22 -07:00
HISTORY Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 13:42:54 -07:00
Porting bpo-30737: Update DevGuide links to new URL (GH-3228) 2017-08-30 09:37:43 -07:00
README bpo-32159: Revert Misc/svnmap.txt (#4639) 2017-11-29 18:58:33 +01:00
README.AIX Replace KB unit with KiB (#4293) 2017-11-08 14:44:44 -08:00
README.coverity
README.valgrind bpo-18859: Document --with-valgrind option in README.valgrind (#10591) 2018-11-20 12:10:49 +01:00
SpecialBuilds.txt bpo-36722: Style and grammar edits for ABI news entries (GH-12979) 2019-04-27 20:14:35 +02:00
coverity_model.c bpo-35808: Retire pgen and use pgen2 to generate the parser (GH-11814) 2019-03-01 15:34:44 -08:00
gdbinit [3.8] bpo-15817: gdbinit: Document commands after defining them (GH-15021) (#15744) 2019-09-09 04:56:38 -05:00
indent.pro
python-config.in bpo-36721: Add --embed option to python-config (GH-13500) 2019-05-23 03:30:23 +02:00
python-config.sh.in bpo-37925: Mention --embed in python-config usage (GH-15458) 2019-08-26 14:55:31 -07:00
python-embed.pc.in bpo-36721: Add --embed option to python-config (GH-13500) 2019-05-23 03:30:23 +02:00
python-wing3.wpr
python-wing4.wpr
python-wing5.wpr Issue 17457: extend test discovery to support namespace packages 2013-11-23 13:29:23 +00:00
python.man bpo-29535: Remove promize about hash randomization of datetime objects. (GH-15269) 2019-08-24 03:19:51 -07:00
python.pc.in bpo-36721: Add --embed option to python-config (GH-13500) 2019-05-23 03:30:23 +02:00
svnmap.txt bpo-32159: Revert Misc/svnmap.txt (#4639) 2017-11-29 18:58:33 +01:00
valgrind-python.supp closes bpo-34377: Update Valgrind suppressions. (GH-8729) 2018-08-10 23:41:34 -07:00
vgrindefs

README

Python Misc subdirectory
========================

This directory contains files that wouldn't fit in elsewhere.  Some
documents are only of historic importance.

Files found here
----------------

ACKS                    Acknowledgements
gdbinit                 Handy stuff to put in your .gdbinit file, if you use gdb
HISTORY                 News from previous releases -- oldest last
indent.pro              GNU indent profile approximating my C style
NEWS                    News for this release (for some meaning of "this")
Porting                 Mini-FAQ on porting to new platforms
python-config.in        Python script template for python-config
python.man              UNIX man page for the python interpreter
python.pc.in            Package configuration info template for pkg-config
python-wing*.wpr        Wing IDE project file
README                  The file you're reading now
README.AIX              Information about using Python on AIX
README.coverity         Information about running Coverity's Prevent on Python
README.valgrind         Information for Valgrind users, see valgrind-python.supp
SpecialBuilds.txt       Describes extra symbols you can set for debug builds
svnmap.txt              Map of old SVN revs and branches to hg changeset ids,
                        help history-digging
valgrind-python.supp    Valgrind suppression file, see README.valgrind
vgrindefs               Python configuration for vgrind (a generic pretty printer)