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
I initially stumbled upon this when seeing *.ps1 has eol=crlf. Merged PR #125 assumes that PowerShell is cross-platform and therefore shouldn't have CRLF specified, while the merged PR #129 overrides the previous one and assumes it is Windows-specific. I think that *.ps1 files shouldn't have CRLF specified by default, since teams can use PowerShell as their terminal on both Windows and Unix-like systems.
The general question of whether line endings should be coerced at all in .gitattributes is worth asking. This guide suggests that .gitattributes overrides the core.autocrlf setting, which could be surprising for the uninitiated. I personally prefer using core.autocrlf to standardize across platforms, and line ending overrides in .gitattributes are surprising to me, at least.
I'm curious as to your rationale for specifying line endings in .gitattributes. I think it's fine whatever you decide! But maybe a disclaimer is warranted in the readme, as to the philosophy behind this decision. If it's signposted, then users with a different mindset can remove those EOL specifications. I know it's hard to devise a single "source of truth" for anything, let alone the esoteric details behind .gitattributes, so to attempt to standardize on anything at all is an admirable effort.
The text was updated successfully, but these errors were encountered:
There are cases when this is realy needed. Especially for .cmd, .bat and .sh files.
As the PowerShell Core is cross platform, I don't think the CRLF should be enforced for .ps1 files anymore.
On the otherhand the .sh files really must be LF only. This is required when working with .sh on Windows and running them using MinGW or WSL in case the repository was checked-out on Windows.
Simillary when I checkout repository inside WSL but I need to run some scripts which are .cmd or .bat files on the Windows side, they must be CRLF.
I initially stumbled upon this when seeing
*.ps1
haseol=crlf
. Merged PR #125 assumes that PowerShell is cross-platform and therefore shouldn't have CRLF specified, while the merged PR #129 overrides the previous one and assumes it is Windows-specific. I think that*.ps1
files shouldn't have CRLF specified by default, since teams can use PowerShell as their terminal on both Windows and Unix-like systems.The general question of whether line endings should be coerced at all in
.gitattributes
is worth asking. This guide suggests that.gitattributes
overrides thecore.autocrlf
setting, which could be surprising for the uninitiated. I personally prefer usingcore.autocrlf
to standardize across platforms, and line ending overrides in.gitattributes
are surprising to me, at least.I'm curious as to your rationale for specifying line endings in
.gitattributes
. I think it's fine whatever you decide! But maybe a disclaimer is warranted in the readme, as to the philosophy behind this decision. If it's signposted, then users with a different mindset can remove those EOL specifications. I know it's hard to devise a single "source of truth" for anything, let alone the esoteric details behind.gitattributes
, so to attempt to standardize on anything at all is an admirable effort.The text was updated successfully, but these errors were encountered: