# =============================================================================
# Nakagawa Recomp .gitattributes
# Normalise line endings for text; protect binary assets from CRLF corruption.
# Without binary marking, git may rewrite .dll/.bin/.iso/.elf on checkout and
# silently corrupt the loader/runtime or any accidentally-committed game data.
# =============================================================================

# Source / text: enforce LF on checkout and in the repo. Content detection
# already classifies every tracked source, script, and document as text.
*                 text=auto eol=lf

# Binaries: never touch line endings.
*.dll             binary
*.exe             binary
*.so              binary
*.bin             binary
*.elf             binary
*.iso             binary
*.cso             binary
*.zso             binary
*.chd             binary
*.dax             binary
*.jso             binary
*.[pP][bB][pP]    binary
*.[pP][rR][xX]    binary
*.[vV][aA][gG]    binary
*.[aA][tT]3       binary
*.pgf             binary
*.ppm             binary
*.png             binary
*.jpg             binary
*.jpeg            binary
*.webp            binary
*.mp4             binary
*.ogg             binary
*.dat             binary
*.pgm             binary
*.gim             binary
*.pmf             binary
*.psar            binary
*.edat            binary
*.sfo             binary
*.spv             binary
*.o               binary
*.obj             binary
*.gif             binary
*.ico             binary
*.bmp             binary
*.wav             binary
*.ttf             binary
*.otf             binary
*.woff            binary
*.woff2           binary
*.zip             binary
*.7z              binary
*.gz              binary
*.pdf             binary
*.a               binary
*.lib             binary
*.pdb             binary

# GitHub language statistics and diff display (Linguist). Headers are C, not
# C++ or Objective-C; generated output and vendored upstream code are labelled
# so pull request diffs collapse them and the language bar counts project code.
*.h                                   linguist-language=C
*.inc                                 linguist-language=C
src/core/generated/**                 linguist-generated
src/rt/nid_names.h                    linguist-generated
src/rt/gpu_sdl3vk/*.inc               linguist-generated
src/ui/shaders/*.inc                  linguist-generated
assets/public_provenance_ledger.json  linguist-generated
PUBLIC_EXPORT.json                    linguist-generated
third_party/**                        linguist-vendored

# Byte-exact upstream FFmpeg import (src/rt/h264_ffmpeg_sub/PROVENANCE.md): this file ends in a blank
# line upstream, and the blob hash in the manifest must not change.
src/rt/h264_ffmpeg_sub/libavcodec/h264_mc_template.c -whitespace
# Byte-identical upstream import whose two whitespace-only lines end in spaces
# (third_party/dr_libs/PROVENANCE.md): exempt it from the trailing-space check
# so `git diff --check` and the staged-whitespace hook keep its bytes intact.
third_party/dr_libs/dr_wav.h          whitespace=-blank-at-eol
# The Khronos OpenXR header (src/rt/xr/openxr/PROVENANCE.md) is byte-identical upstream and
# ends one blank line in spaces: exempt it the same way.
src/rt/xr/openxr/openxr.h             whitespace=-blank-at-eol
# libchdr and the codecs it carries (third_party/libchdr/PROVENANCE.md) keep their
# upstream bytes apart from LF line endings, and upstream ends some lines in spaces
# and mixes tabs and spaces: exempt the imported files from the whitespace checks so
# `git diff --check` and the staged-whitespace hook leave them as imported. The
# project-authored manifest keeps the normal rules.
third_party/libchdr/**                whitespace=-blank-at-eol,-blank-at-eof,-space-before-tab
third_party/libchdr/PROVENANCE.md     whitespace=blank-at-eol,blank-at-eof,space-before-tab
# AMD FidelityFX SDK headers (third_party/fidelityfx_sdk/PROVENANCE.md): upstream ends some
# lines in spaces and indents one with a tab, so the imports are exempt from the whitespace
# checks; the project-authored manifest keeps the normal rules.
third_party/fidelityfx_sdk/**             whitespace=-blank-at-eol,-blank-at-eof,-space-before-tab,-indent-with-non-tab
third_party/fidelityfx_sdk/PROVENANCE.md  whitespace=blank-at-eol,blank-at-eof,space-before-tab
# stb_vorbis (third_party/stb/PROVENANCE.md) is byte-identical upstream, which ends some lines in
# spaces and the file in a blank line: exempt it the same way so its blob ID stays the pinned one.
third_party/stb/stb_vorbis.c              whitespace=-blank-at-eol,-blank-at-eof,-space-before-tab,-indent-with-non-tab

# Parallel additions to these hand-maintained lists merge without a conflict (docs/CI.md, "Merging
# parallel additions"): tools/merge_append.py keeps both sides when each only inserted lines at the same
# spot, and leaves the ordinary conflict markers when either side changed or removed a line. Only files whose
# conflicts are independent items (self-test blocks, targets, sources, table rows) belong here: never C, a
# generated file or prose (tools/test_merge_append.py pins this). Git uses the driver only after the clone
# sets merge.nk-append.driver; without it the attribute is ignored and the merge is the ordinary one.
mk/selftests.mk                       merge=nk-append
mk/public_targets.mk                  merge=nk-append
mk/runtime_sources.mk                 merge=nk-append
CMakeLists.txt                        merge=nk-append
docs/DEBUGGING.md                     merge=nk-append
