Skip to content

Conversation

@yurekami
Copy link
Contributor

Summary

Add .gitattributes to ensure consistent Git behavior across platforms.

Features:

Line Endings

  • Normalize all text files to LF (Unix-style)
  • Prevents CRLF/LF conflicts when collaborating across Windows/Linux/macOS

Language-Aware Diffs

File Type Diff Driver
Python (*.py, *.pyi) diff=python
C++/CUDA (*.cpp, *.cu, etc.) diff=cpp
Markdown (*.md) diff=markdown
Shell (*.sh) diff=bash

Binary Files

  • Images, archives, compiled files marked as binary
  • Prevents accidental corruption

GitHub Linguist

  • third-party/** marked as vendored (excluded from language stats)
  • stubs/** marked as generated
  • Results in more accurate repository language statistics

Test plan

  • Valid .gitattributes syntax
  • Verify line endings are normalized on checkout
  • Check GitHub language stats exclude vendored code

🤖 Generated with Claude Code

Add .gitattributes to ensure consistent behavior across platforms:

Line Endings:
- Normalize all text files to LF (Unix-style)
- Prevents CRLF/LF issues when collaborating across Windows/Linux/macOS

Diff Improvements:
- Python files: Use Python-aware diff heuristics
- C++/CUDA files: Use C++-aware diff heuristics
- Markdown: Use markdown-aware diff
- Shell scripts: Use bash-aware diff

Binary Files:
- Mark images, archives, and compiled files as binary
- Prevents accidental corruption of binary content

GitHub Linguist:
- Mark third-party code as vendored (excluded from language stats)
- Mark generated stubs as generated

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant