Skip to content

Commit

Permalink
Fix fbsource import of cpython 3.12
Browse files Browse the repository at this point in the history
Summary:
For complicated reasons the Meta source code syncing infrastructure cannot support .gitattributes macros, as documented here:

https://git-scm.com/docs/gitattributes#_defining_macro_attributes

Note especially this part:

> not in .gitattributes files in working tree subdirectories

The logic we use to extract a slice of the Meta monorepo and create a git repo for use on GitHub mangles the repo contents since this file is not at the "root" of the temporary exported git repo. Reworking our logic to fix this inside the code syncing logic turned out to not be possible without extended effort that is not worth it right now.

So instead we just backout these commits:

1. python/cpython@0b906ae
2. python/cpython@f1e559b

(I didn't ACTUALLY revert them, just fixed the lines in-place (see the rearranging done in the second commit))

Reviewed By: itamaro

Differential Revision: D52377523

fbshipit-source-id: 0307ab4bbfbcd45ffeeb1c4ebb0f539eaad9868b
  • Loading branch information
bigfootjon authored and facebook-github-bot committed Dec 21, 2023
1 parent da4835e commit b1a1db5
Showing 1 changed file with 47 additions and 47 deletions.
94 changes: 47 additions & 47 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@ Lib/test/sndhdrdata/sndhdr.* binary
PC/classicAppCompat.* binary

# Text files that should not be subject to eol conversion
[attr]noeol -text

Lib/test/cjkencodings/* noeol
Lib/test/tokenizedata/coding20731.py noeol
Lib/test/decimaltestdata/*.decTest noeol
Lib/test/test_email/data/*.txt noeol
Lib/test/test_importlib/resources/data01/* noeol
Lib/test/test_importlib/resources/namespacedata01/* noeol
Lib/test/xmltestdata/* noeol
# START META PATCH (manually expand gitattributes macros due to ShipIt limitations)
Lib/test/cjkencodings/* -text
Lib/test/tokenizedata/coding20731.py -text
Lib/test/decimaltestdata/*.decTest -text
Lib/test/test_email/data/*.txt -text
Lib/test/test_importlib/resources/data01/* -text
Lib/test/test_importlib/resources/namespacedata01/* -text
Lib/test/xmltestdata/* -text
# END META PATCH

# Shell scripts should have LF even on Windows because of Cygwin
Lib/venv/scripts/common/activate text eol=lf
Lib/venv/scripts/posix/* text eol=lf

# CRLF files
[attr]dos text eol=crlf

*.bat dos
*.proj dos
*.props dos
*.ps1 dos
*.sln dos
*.vcxproj* dos
PC/readme.txt dos
PCbuild/readme.txt dos
# START META PATCH (manually expand gitattributes macros due to ShipIt limitations)
*.bat text eol=crlf
*.proj text eol=crlf
*.props text eol=crlf
*.ps1 text eol=crlf
*.sln text eol=crlf
*.vcxproj* text eol=crlf
PC/readme.txt text eol=crlf
PCbuild/readme.txt text eol=crlf
# END META PATCH

# Language aware diff headers
# https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more
Expand All @@ -64,31 +64,31 @@ PCbuild/readme.txt dos
# To always hide generated files in local diffs, mark them as binary:
# $ git config diff.generated.binary true
#
[attr]generated linguist-generated=true diff=generated

**/clinic/*.c.h generated
*_db.h generated
Doc/data/stable_abi.dat generated
Doc/library/token-list.inc generated
Include/internal/pycore_ast.h generated
Include/internal/pycore_ast_state.h generated
Include/internal/pycore_opcode.h generated
Include/internal/pycore_*_generated.h generated
Include/opcode.h generated
Include/token.h generated
Lib/keyword.py generated
Lib/test/levenshtein_examples.json generated
Lib/test/test_stable_abi_ctypes.py generated
Lib/token.py generated
Objects/typeslots.inc generated
PC/python3dll.c generated
Parser/parser.c generated
Parser/token.c generated
Programs/test_frozenmain.h generated
Python/Python-ast.c generated
Python/generated_cases.c.h generated
Python/opcode_targets.h generated
Python/stdlib_module_names.h generated
Tools/peg_generator/pegen/grammar_parser.py generated
aclocal.m4 generated
configure generated
# START META PATCH (manually expand gitattributes macros due to ShipIt limitations)
**/clinic/*.c.h linguist-generated=true diff=generated
*_db.h linguist-generated=true diff=generated
Doc/data/stable_abi.dat linguist-generated=true diff=generated
Doc/library/token-list.inc linguist-generated=true diff=generated
Include/internal/pycore_ast.h linguist-generated=true diff=generated
Include/internal/pycore_ast_state.h linguist-generated=true diff=generated
Include/internal/pycore_opcode.h linguist-generated=true diff=generated
Include/internal/pycore_*_generated.h linguist-generated=true diff=generated
Include/opcode.h linguist-generated=true diff=generated
Include/token.h linguist-generated=true diff=generated
Lib/keyword.py linguist-generated=true diff=generated
Lib/test/levenshtein_examples.json linguist-generated=true diff=generated
Lib/test/test_stable_abi_ctypes.py linguist-generated=true diff=generated
Lib/token.py linguist-generated=true diff=generated
Objects/typeslots.inc linguist-generated=true diff=generated
PC/python3dll.c linguist-generated=true diff=generated
Parser/parser.c linguist-generated=true diff=generated
Parser/token.c linguist-generated=true diff=generated
Programs/test_frozenmain.h linguist-generated=true diff=generated
Python/Python-ast.c linguist-generated=true diff=generated
Python/generated_cases.c.h linguist-generated=true diff=generated
Python/opcode_targets.h linguist-generated=true diff=generated
Python/stdlib_module_names.h linguist-generated=true diff=generated
Tools/peg_generator/pegen/grammar_parser.py linguist-generated=true diff=generated
aclocal.m4 linguist-generated=true diff=generated
configure linguist-generated=true diff=generated
# END META PATCH

0 comments on commit b1a1db5

Please sign in to comment.