View Revisions: Issue #6975
Summary | 0006975: Set up gitattributes for Git consistently update line endings for Windows and other file systems | ||
---|---|---|---|
Revision | 2025-06-24 14:01 by pbelov | ||
Description | Currently a text file created in Windows has CR LF characters at the end of the line, while Linux and MAC OS uses just one. Set up the .gitattributes file for all Git repositories to consistently update line endings for Windows and other file systems. |
||
Revision | 2025-06-24 14:29 by pbelov | ||
Description | Currently a text file created in Windows has CR LF characters at the end of the line, while Linux and MAC OS uses just one. Set up the .gitattributes file for all Git repositories to consistently update line endings for Windows and other file systems. Goal: avoid false-positive reports of code differences, when the line endings are the only change. Also review the GitAttributesGenerator class? |
||
Revision | 2025-06-24 14:01 by pbelov | ||
Steps To Reproduce | End a text file on Windows Check-in Pull code to MAC or Linux Observe build error: |
||
Revision | 2025-06-24 14:29 by pbelov | ||
Steps To Reproduce | End a text file on Windows Check-in Pull code to MAC or Linux Observe build error: See also: https://docs.github.com/en/get-started/git-basics/configuring-git-to-handle-line-endings https://stackoverflow.com/questions/73086622/is-a-gitattributes-file-really-necessary-for-git |
||
Revision | 2025-06-24 14:01 by pbelov | ||
Additional Information | Draft proposal of the .gitattributes file: |
||
Revision | 2025-06-24 14:29 by pbelov | ||
Additional Information | Draft proposal of the .gitattributes file: # The gitattributes instructs GIT how to handle line endings automatically for various file types * text=auto # # The above will handle all files NOT found below # # These files are text and should be normalized (Convert crlf => lf) *.gitattributes text .gitignore text *.md text diff=markdown # Java sources *.java text diff=java *.kt text diff=kotlin *.groovy text diff=java *.scala text diff=java *.gradle text diff=java *.gradle.kts text diff=kotlin # These files are text and should be normalized (Convert crlf => lf) *.css text diff=css *.scss text diff=css *.sass text *.df text *.htm text diff=html *.html text diff=html *.js text *.mjs text *.cjs text *.jsp text *.jspf text *.jspx text *.properties text *.tld text *.tag text *.tagx text *.xml text # These files are binary and should be left untouched # (binary is a macro for -text -diff) *.class binary *.dll binary *.ear binary *.jar binary *.so binary *.war binary *.jks binary # Common build-tool wrapper scripts ('.cmd' versions are handled by 'Common.gitattributes') mvnw text eol=lf gradlew text eol=lf # These are explicitly windows files and should use crlf *.bat text eol=crlf |
||
Revision | 2025-06-24 15:05 by awebb | ||
Description | Currently a text file created in Windows has CR LF characters at the end of the line, while Linux and MAC OS uses just one. Set up the .gitattributes file for all Git repositories to consistently update line endings for Windows and other file systems. Goal: avoid false-positive reports of code differences, when the line endings are the only change. Also review the GitAttributesGenerator class? Several files have this issue currently. They can be seen by running "./gradlew clean build" in the PRO project. The line endings cause the build to fail with the error: "Task :symmetric-pro:spotlessJavaCheck FAILED". Gradle reports the code violations, where you can see the line endings present, for example: "-package com.jumpmind.symmetric.console.ui.wizard.load;\r\n". Files include: com/jumpmind/symmetric/console/ui/wizard/load/TableSetupInProgressScreen.java, com/jumpmind/symmetric/console/ui/wizard/load/TableSetupIncompleteScreen.java, though there are others. The code violations can be fixed by running, for example: "./gradlew :symmetric-pro:spotlessApply". Though the intent here is to use gitattributes to address these violations automatically. |