mangosone-server/.gitattributes
MadMax dda3549728
Define source file line-ending attributes (#357)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 19:54:13 +01:00

95 lines
3.3 KiB
Text

# ============================================================================
# Line-ending and whitespace attributes
#
# Goal: keep source/text files normalized so that replacing a file with a
# copy that only differs in CRLF/LF does NOT show up as a whole-file diff.
# This defines behaviour going forward only; no mass renormalization is done.
# ============================================================================
# Let Git handle text detection and normalize text to LF in the repository.
* text=auto
# ----------------------------------------------------------------------------
# C/C++ source -> stored and checked out as LF
# ----------------------------------------------------------------------------
*.c text eol=lf
*.cc text eol=lf
*.cpp text eol=lf
*.cxx text eol=lf
*.h text eol=lf
*.hpp text eol=lf
*.hxx text eol=lf
*.inl text eol=lf
# Generated revision headers must stay LF
src/shared/revision_nr.h text eol=lf
src/shared/revision_sql.h text eol=lf
# ----------------------------------------------------------------------------
# CMake, config and other text files -> LF
# ----------------------------------------------------------------------------
CMakeLists.txt text eol=lf
*.cmake text eol=lf
*.sql text eol=lf
*.txt text eol=lf
*.md text eol=lf
*.xml text eol=lf
*.conf text eol=lf
*.dist text eol=lf
*.json text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
# ----------------------------------------------------------------------------
# Unix shell scripts -> LF
# ----------------------------------------------------------------------------
*.sh text eol=lf
# ----------------------------------------------------------------------------
# Windows scripts and Visual Studio project files -> CRLF
# ----------------------------------------------------------------------------
*.sln text eol=crlf
*.vcproj text eol=crlf
*.vcxproj* text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
# ----------------------------------------------------------------------------
# Binary / runtime artifacts -> never normalize
# ----------------------------------------------------------------------------
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.bmp binary
*.mpq binary
*.dbc binary
*.db2 binary
*.map binary
*.vmap binary
*.mmap binary
*.lib binary
*.dll binary
*.exe binary
*.pdb binary
*.zip binary
*.7z binary
*.gz binary
*.tar binary
# ============================================================================
# Whitespace rules (preserved from the original .gitattributes)
# ============================================================================
# strict (no trailing, no tabs)
*.cpp whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol
*.h whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol
# normal (no trailing)
*.sql whitespace=trailing-space,space-before-tab,cr-at-eol
*.txt whitespace=trailing-space,space-before-tab,cr-at-eol
# special files which must ignore whitespace
*.patch whitespace=-trailing-space