From f9345ed38a5a945c5a23030105d1c2f54674cf29 Mon Sep 17 00:00:00 2001 From: Susko3 Date: Mon, 23 Jun 2025 22:41:40 +0200 Subject: [PATCH] Fix checkout line endings in .g.cs files ClangSharp will always generate files with LF, but the --headerFile is copied as-is. This resulted in files with CR LF and LF line endings, confusing git which would always report changes in line endings. This is fixed by checking out *.g.cs and the license headers fed into ClangSharp with LF. The files have always beeen normalised to LF endings on commit, so this change is not visible in git. --- .gitattributes | 6 +++++- SDL3-CS/{SDL.licenseheader => SDL-license-header.txt} | 0 SDL3-CS/generate_bindings.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) rename SDL3-CS/{SDL.licenseheader => SDL-license-header.txt} (100%) diff --git a/.gitattributes b/.gitattributes index c61ca25..2cddad8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -22,4 +22,8 @@ App.config text eol=crlf .gitignore text eol=lf .gitattributes text eol=lf *.md text eol=lf -.travis.yml text eol=lf \ No newline at end of file +.travis.yml text eol=lf + +# Use lf for files used by ClangSharpPInvokeGenerator +*-license-header.txt text eol=lf +*.g.cs text eol=lf diff --git a/SDL3-CS/SDL.licenseheader b/SDL3-CS/SDL-license-header.txt similarity index 100% rename from SDL3-CS/SDL.licenseheader rename to SDL3-CS/SDL-license-header.txt diff --git a/SDL3-CS/generate_bindings.py b/SDL3-CS/generate_bindings.py index 71666c9..3d17d0d 100644 --- a/SDL3-CS/generate_bindings.py +++ b/SDL3-CS/generate_bindings.py @@ -255,7 +255,7 @@ def typedef(t): base_command = [ "dotnet", "tool", "run", "ClangSharpPInvokeGenerator", - "--headerFile", csproj_root / "SDL.licenseheader", + "--headerFile", csproj_root / "SDL-license-header.txt", "--config", "latest-codegen",