View Issue Details

IDProjectCategoryView StatusLast Update
0006975SymmetricDSImprovementpublic2025-06-30 14:48
Reporterpbelov Assigned Toawebb  
Prioritynormal 
Status assignedResolutionopen 
Product Version3.15.0 
Summary0006975: Set up gitattributes for Git consistently update line endings for Windows and other file systems
DescriptionCurrently 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.
Steps To ReproduceEnd 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
Additional InformationDraft 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
Tagsquality engineering

Activities

pbelov

2025-06-24 14:29

manager   ~0003134

Top 30 extensions in the SymmetricDS repository:
find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort | uniq -c | sort -n > repo_extensions.txt
      8 csv
     10 dll
     10 gif
     11 jar
     11 php
     12 md
     13 md5
     13 sha1
     14 txt
     15 css
     16 html
     22 bat
     30 launch
     31 gradle
     36 sql
     39 jpg
     48 properties
     56 sample
     62 gitignore
     71 xml
    124 c
    130 h
    138 ad
    326 js
    550 png
   2146 java

awebb

2025-06-30 14:48

developer   ~0003144

PR: https://github.com/JumpMind/symmetric-ds/pull/311

Issue History

Date Modified Username Field Change
2025-06-24 14:01 pbelov New Issue
2025-06-24 14:01 pbelov Status new => assigned
2025-06-24 14:01 pbelov Assigned To => awebb
2025-06-24 14:01 pbelov Tag Attached: quality engineering
2025-06-24 14:29 pbelov Description Updated View Revisions
2025-06-24 14:29 pbelov Steps to Reproduce Updated View Revisions
2025-06-24 14:29 pbelov Additional Information Updated View Revisions
2025-06-24 14:29 pbelov Note Added: 0003134
2025-06-24 15:05 awebb Description Updated View Revisions
2025-06-30 14:48 awebb Note Added: 0003144