Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add *.py diff=python to .gitattributes #4531

Merged
merged 3 commits into from
Dec 11, 2024
Merged

Conversation

MeGaGiGaGon
Copy link
Contributor

This adds the line *.py text diff=python to .gitattributes. I'm not 100% certain on all the effects this has, but it makes function name based finding git commands options like git log -L :<function_name>:<file_path> or git blame -L :<function_name> <file_path> work out of the box, which is a nice convenience.

@MeGaGiGaGon MeGaGiGaGon changed the title Add .py text diff=python to .gitattributes Add *.py text diff=python to .gitattributes Dec 9, 2024
@JelleZijlstra JelleZijlstra added the skip news Pull requests that don't need a changelog entry. label Dec 10, 2024
@JelleZijlstra
Copy link
Collaborator

This appears to break test, something with CRLF last names.

diff --git a/tests/data/cases/preview_long_strings__east_asian_width.py b/tests/data/cases/preview_long_strings__east_asian_width.py

@MeGaGiGaGon MeGaGiGaGon changed the title Add *.py text diff=python to .gitattributes Add *.py diff=python to .gitattributes Dec 11, 2024
@MeGaGiGaGon
Copy link
Contributor Author

As far as I can tell, the issue was because windows. I don't understand why anything broke, since github should use core.autocrlf=true by default, which should have the same behavior as text, but it doesn't. Removing the text still lets the diff function names work, but fixes the line ending nonsense to still be the core.autocrlf behavior.

@JelleZijlstra JelleZijlstra merged commit 30759ca into psf:main Dec 11, 2024
43 checks passed
@MeGaGiGaGon MeGaGiGaGon deleted the patch-1 branch December 11, 2024 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news Pull requests that don't need a changelog entry.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants