diff --git a/.gitattributes b/.gitattributes index 25a66f60..bcc77a4f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,6 +5,12 @@ # Anything binary NOT listed here still commits fine (just not LFS-optimized) — the # post-stage size check catches large stragglers. +# ---- Byte-for-byte mirror: NO end-of-line conversion on ANY machine ---- +# This overrides each cloner's global core.autocrlf (Git-for-Windows defaults it to true, +# which would expand LF->CRLF on checkout). With `* -text`, git never converts EOLs, so a +# clone restores files exactly as committed. `diff` overrides below keep source readable. +* -text + # ---- Game/art assets ---- *.tga filter=lfs diff=lfs merge=lfs -text *.bmp filter=lfs diff=lfs merge=lfs -text @@ -75,6 +81,30 @@ *.db filter=lfs diff=lfs merge=lfs -text *.mr filter=lfs diff=lfs merge=lfs -text -# NOTE: intentionally NO `text`/eol attributes. This is a byte-for-byte mirror — with -# core.autocrlf=false and no text attrs, git stores/restores text files exactly as-is -# (no LF<->CRLF conversion) and still auto-detects text for diffs. Do not add `text` here. +# ---- Readable diffs for text/source (force textual diff; `-text` above still prevents +# any EOL conversion, so byte-exactness is preserved) ---- +*.cpp diff +*.hpp diff +*.h diff +*.c diff +*.inl diff +*.idl diff +*.rc diff +*.def diff +*.dsp diff +*.dsw diff +*.mak diff +*.script diff +*.build diff +*.instance diff +*.contents diff +*.subsystems diff +*.abl diff +*.abi diff +*.hint diff +*.txt diff +*.md diff +*.ps1 diff +*.bat diff +*.reg diff +*.h diff