Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .gitattributes file to manage line endings #1472

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

WajahatKanju
Copy link
Contributor

Pull Request: Config Compatibility - Line Endings Fix

Description:
This pull request addresses a configuration compatibility issue related to line endings when setting up the Django project using Docker on Windows. The problem arises from the docker-entrypoint.sh file having Windows line endings (CRLF) instead of the expected Linux line endings (LF), causing script execution errors during docker-compose up.fix issue #1467 and #990

Changes Made:

  1. Added a .gitattributes file to the repository to specify LF line endings for .sh files.

Steps to Reproduce:

  • Clone the Django project on a Windows machine.
  • Follow instructions in the documentation under "Running Locally with Docker."
  • Run docker-compose build and docker-compose up.
  • Observe the error related to docker-entrypoint.sh script execution.

Expected Results:

  • The docker-entrypoint.sh file should maintain its original Linux line endings (LF) and execute correctly in the Docker environment.

Actual Results:

  • The file's line endings are converted to Windows style (CRLF), leading to execution problems in Docker. This issue occurs only on Windows when lines are auto-converted to CRLF.

Environment:

  • Operating System: Windows 10
  • Docker Version: 24.0.7, build afdd53b

Proposed Solution:

  • Added a .gitattributes file to manage line endings for .sh files.
  • Updated documentation to guide Windows users in configuring Git for correct line endings.

Contributor's Note:
I have tested the changes on my local environment, and they resolve the line ending issue. This pull request is submitted in accordance with the Django project's contribution guidelines.


Checklist:

  • All existing tests pass.

@bmispelon bmispelon force-pushed the config/line-endings-fix branch from 322e394 to 051927e Compare June 26, 2024 14:51
@bmispelon bmispelon merged commit 15beb3a into django:main Jun 26, 2024
2 checks passed
@bmispelon
Copy link
Member

Finally got around to looking at this. Thanks for your contribution! 🚀

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.

2 participants