From 4bb9f5408408aca1161082c801c1a1a84065b901 Mon Sep 17 00:00:00 2001 From: 0xDevNinja Date: Thu, 25 Jun 2026 18:49:45 +0530 Subject: [PATCH] chore: add .gitattributes to normalize line endings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without a .gitattributes, line-ending normalization depends on each contributor's local core.autocrlf. On Windows checkouts this can materialize text files — and shell scripts like render-demo.sh — with CRLF, which breaks script shebangs and produces noisy cross-platform diffs. Add a root .gitattributes that: - defaults all text files to LF (* text=auto eol=lf) - pins shell scripts, Makefile and .env.example to LF explicitly - keeps .bat/.cmd as CRLF - marks image/video/audio/font assets as binary so Git never normalizes or diffs them Only the policy file is added; existing files are intentionally left unrenormalized to keep this change reviewable. Closes #187 --- .gitattributes | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..5a47c8d5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,51 @@ +# Normalize line endings across platforms. +# +# Default: treat every file as text, auto-detect, and store/check out with LF. +# This keeps Windows, macOS, and Linux checkouts byte-consistent and prevents +# CRLF drift from producing noisy whole-file diffs. +* text=auto eol=lf + +# --- Source code ----------------------------------------------------------- +*.py text eol=lf +*.ts text eol=lf +*.tsx text eol=lf +*.js text eol=lf +*.jsx text eol=lf +*.mjs text eol=lf +*.json text eol=lf +*.yaml text eol=lf +*.yml text eol=lf +*.toml text eol=lf +*.md text eol=lf +*.mdc text eol=lf +*.txt text eol=lf +*.cfg text eol=lf +*.ini text eol=lf + +# --- Newline-sensitive files (must stay LF) -------------------------------- +# A shell script checked out with CRLF has a broken shebang and will not run. +*.sh text eol=lf +Makefile text eol=lf +.env.example text eol=lf + +# Windows batch files, if ever added, must keep CRLF. +*.bat text eol=crlf +*.cmd text eol=crlf + +# --- Binary assets (never normalize or diff) ------------------------------- +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.webp binary +*.ico binary +*.mp4 binary +*.mov binary +*.webm binary +*.mp3 binary +*.wav binary +*.woff binary +*.woff2 binary +*.ttf binary +*.otf binary +*.pdf binary