You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The file-contents-sorter hook replaces all windows-style newlines '\r\n' with linefeed '\n'.
This is especially confusing when using the hook in a git repository with core.autocrlf activated (the default in git for windows, and also used by windows GitHub runners). In this case the hook always fails (and replaces the newlines), but git shows no diff at all, due to line normalization.
This particular case can be worked around by setting gitattributes, but IMO the hook shouldn't be modifying line separators (mixed-line-ending can be used for that).
The text was updated successfully, but these errors were encountered:
Maetveis
changed the title
file-contents-sorter changes newlines to unix-style '\n'file-contents-sorter changes all newlines to unix-style '\n'
Sep 6, 2023
The
file-contents-sorter
hook replaces all windows-style newlines '\r\n' with linefeed '\n'.This is especially confusing when using the hook in a git repository with
core.autocrlf
activated (the default in git for windows, and also used by windows GitHub runners). In this case the hook always fails (and replaces the newlines), but git shows no diff at all, due to line normalization.This particular case can be worked around by setting
gitattributes
, but IMO the hook shouldn't be modifying line separators (mixed-line-ending
can be used for that).The text was updated successfully, but these errors were encountered: