Skip to content

Conversation

@Pil0tXia
Copy link
Member

@Pil0tXia Pil0tXia commented Dec 26, 2023

Fixes #4686.

Motivation

#4686

Modifications

When cloning a repository with Git on Windows, all text files with Unix-style LF line endings are replaced with Windows-style CRLF line endings, including shell scripts that require LF line endings.

By using .gitattributes, the original LF line endings of shell scripts can be preserved, avoiding the need for secondary conversion when using WSL/Docker Desktop, and enabling developers to build binary packages/Docker images on Windows that can run on Linux systems.

Reference: https://code.visualstudio.com/docs/remote/troubleshooting#_resolving-git-line-ending-issues-in-wsl-resulting-in-many-modified-files

To apply the changes, a re-clone is needed.

By the way, some minor doc and code optimization were applied.

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@codecov
Copy link

codecov bot commented Dec 27, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (1a381ed) 17.39% compared to head (fcb2b48) 17.40%.

Files Patch % Lines
.../core/protocol/http/push/AsyncHTTPPushRequest.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #4687   +/-   ##
=========================================
  Coverage     17.39%   17.40%           
- Complexity     1759     1760    +1     
=========================================
  Files           797      797           
  Lines         29850    29850           
  Branches       2579     2579           
=========================================
+ Hits           5192     5194    +2     
+ Misses        24177    24176    -1     
+ Partials        481      480    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Pil0tXia
Copy link
Member Author

Pil0tXia commented Jan 2, 2024

@xwm1992 PTAL~

Copy link
Member

@mxsm mxsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mxsm mxsm merged commit a43357c into apache:master Jan 6, 2024
@Pil0tXia Pil0tXia deleted the pil0txia_crlf2lf branch January 7, 2024 14:22
@xwm1992 xwm1992 added this to the 1.11.0 milestone Dec 18, 2024
xuhongjia pushed a commit to Deckers-Ohana/eventmesh that referenced this pull request Mar 13, 2025
…ache#4687)

* crlf2lf

* convert sh only

* write easily

* Some doc optimization

* minor code change

* add future win scrpts

* add license
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Shell scripts should preserve LF line endings

4 participants