Description
Describe the problem
Hi,
I use Git on Windows with core.autocrlf
set to true, which means line endings on my local machine are CRLF while those on the Git server are LF. However, when I use Copier to fill in variables in Jinja files, it retains the line endings as LF.
This results in significant differences being displayed for the entire Jinja file, even in sections where there are no actual changes post-Copier update. This behavior makes reviewing changes in Jinja files difficult, as the line ending changes obscure the real modifications.
Thank you!
Template
-
On Windows, set the following in your
.gitconfig
:[core] autocrlf = true
-
Clone my sample project from this repository.
-
Run the Copier update command:
copier update --defaults
-
The
app-template/sample-project/sample_module.py
file should ideally show a diff of only one line, but due to the line ending differences, the entire file is displayed in the diff. For reference, I includeapp-template/sample-project/sample_module_new.py
as an example of the expected result (achieved by configuring.gitattributes
, but I would like to achieve this without such settings).
To Reproduce
No response
Logs
Expected behavior
I expect Copier to maintain the appropriate line endings for Jinja files by referencing the Git configuration.
Screenshots/screencasts/logs
No response
Operating system
Windows
Operating system distribution and version
Windows 11 Enterprize
Copier version
9.4.0
Python version
3.10.15
Installation method
pipx+pypi
Additional context
No response