Files
nightclub-arcadia/.gitattributes
T
lennartandClaude Opus 5 382f6c7f63 add .gitattributes: Unity YAML merge driver and line-ending policy
Scenes, prefabs and assets are now marked for UnityYAMLMerge, which is what
makes them mergeable at all — without it a scene conflict is resolved by a
line-oriented text merge that produces a file Unity may still load and that is
quietly wrong. The driver needs a one-time git config per machine; CLAUDE.md
carries the command.

Line endings are pinned to LF for every text type rather than left to
`text=auto`, so the 71 CRLF files vendored in StarterAssets stop being a source
of phantom diffs.

One exception, and it matters: DialogueTest.unity is marked `binary`. It is a
Unity binary SerializedFile rather than YAML, and it contains 128 lone CR bytes
— under `*.unity text eol=lf` git would rewrite those as line endings and
corrupt the scene. The rule carries the verification command and comes out as
soon as the file is genuinely text.

LFS is deliberately not enabled: the remote is self-hosted and its LFS support
is unverified, and enabling the filter against a server without it breaks
pushing. The rules to add later, and the migration step that has to accompany
them, are recorded in the file.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-25 20:28:06 +02:00

115 lines
4.8 KiB
Plaintext

# Nightclub Arcadia — git attributes
#
# Two jobs: make Unity's YAML files mergeable, and keep line endings from
# becoming a source of phantom diffs.
# ---------------------------------------------------------------------------
# Unity YAML — text, LF, and merged with UnityYAMLMerge
# ---------------------------------------------------------------------------
# The merge driver needs a one-time setup per machine; see §"Merge driver" in
# CLAUDE.md. Without it git falls back to a normal text merge, which for scenes
# and prefabs means conflicts that are painful but not silently wrong.
*.unity text eol=lf merge=unityyamlmerge
*.prefab text eol=lf merge=unityyamlmerge
*.asset text eol=lf merge=unityyamlmerge
*.mat text eol=lf merge=unityyamlmerge
*.anim text eol=lf merge=unityyamlmerge
*.controller text eol=lf merge=unityyamlmerge
*.overrideController text eol=lf merge=unityyamlmerge
*.physicMaterial text eol=lf merge=unityyamlmerge
*.physicsMaterial2D text eol=lf merge=unityyamlmerge
*.playable text eol=lf merge=unityyamlmerge
*.mask text eol=lf merge=unityyamlmerge
*.brush text eol=lf merge=unityyamlmerge
*.flare text eol=lf merge=unityyamlmerge
*.lighting text eol=lf merge=unityyamlmerge
*.terrainlayer text eol=lf merge=unityyamlmerge
*.signal text eol=lf merge=unityyamlmerge
*.guiskin text eol=lf merge=unityyamlmerge
*.fontsettings text eol=lf merge=unityyamlmerge
*.meta text eol=lf
# ---------------------------------------------------------------------------
# EXCEPTION — a scene that is serialized as BINARY
# ---------------------------------------------------------------------------
# DialogueTest.unity is a Unity binary SerializedFile, not YAML, despite the
# project being set to Force Text. It contains 128 lone CR bytes, so treating it
# as text would have git rewrite them as line endings and corrupt the scene.
#
# Remove this line the moment the file is genuinely text — verify with:
# head -c 20 NightclubArcadia/Assets/Scenes/DialogueTest.unity # want %YAML 1.1
# Background and the fix: docs/restructure-plan.md §0.1
/NightclubArcadia/Assets/Scenes/DialogueTest.unity binary
# ---------------------------------------------------------------------------
# Source, config and prose
# ---------------------------------------------------------------------------
*.cs text eol=lf diff=csharp
*.yarn text eol=lf
*.yarnproject text eol=lf
*.asmdef text eol=lf
*.asmref text eol=lf
*.inputactions text eol=lf
*.shader text eol=lf
*.compute text eol=lf
*.cginc text eol=lf
*.hlsl text eol=lf
*.shadergraph text eol=lf
*.json text eol=lf
*.md text eol=lf
*.txt text eol=lf
*.py text eol=lf
*.sh text eol=lf
*.csproj text eol=lf
*.xml text eol=lf
*.gitattributes text eol=lf
*.gitignore text eol=lf
# ---------------------------------------------------------------------------
# Binary — never diffed, never line-ending converted
# ---------------------------------------------------------------------------
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.tga binary
*.tif binary
*.tiff binary
*.psd binary
*.exr binary
*.hdr binary
*.fbx binary
*.obj binary
*.blend binary
*.wav binary
*.mp3 binary
*.ogg binary
*.aif binary
*.ttf binary
*.otf binary
*.pdf binary
*.dll binary
*.pdb binary
*.so binary
*.dylib binary
*.bundle binary
*.a binary
*.unitypackage binary
*.cubemap binary
# ---------------------------------------------------------------------------
# Git LFS — deliberately NOT enabled yet
# ---------------------------------------------------------------------------
# git-lfs is installed locally, but this repo pushes to a self-hosted server
# whose LFS support has not been verified, and enabling LFS against a server
# that lacks it breaks pushing. There is also almost nothing to store yet: one
# placeholder PNG plus the StarterAssets meshes.
#
# When real art lands, verify the server first, then add:
# *.png filter=lfs diff=lfs merge=lfs -text
# *.fbx filter=lfs diff=lfs merge=lfs -text
# *.wav filter=lfs diff=lfs merge=lfs -text
# and migrate existing blobs with `git lfs migrate import --include=...`.
# Adding the filter without migrating leaves old blobs outside LFS, which is
# confusing rather than broken.