Skip to content

Commit

Permalink
build: add .gitattributes for npm and other shims
Browse files Browse the repository at this point in the history
This issue has been described in -
#43860

On Windows system, git clone or git checkout on the repo turns LF line
endings to CRLF in the worktree.
This can happen due to many reasons like -
- git config --system core.autocrlf (set to true)
- git config --global core.autocrlf (set to true)
- git config --local core.autocrlf (set to true)
- git clone --config core.autocrlf=true ...

Adding gitattributes for the shims will not convert them to CRLF line
endings.

Also, there is a note[1] in test/README.md which says -
For the tests to run on Windows, be sure to clone Node.js source code
with the `autocrlf` git config flag set to true.

Reason for using build subsystem -
These shims are just copied in stage_package label of vcbuild.bat

Fixes: #43860
[1]: 3654cd4

PR-URL: #43879
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
hrishikesh-kadam committed Jul 19, 2022
1 parent dd167ff commit 4aeef8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test/fixtures/* -text
vcbuild.bat text eol=crlf
deps/npm/bin/npm text eol=lf
deps/npm/bin/npx text eol=lf
deps/corepack/shims/corepack text eol=lf
tools/msvs/find_python.cmd text eol=crlf

0 comments on commit 4aeef8e

Please sign in to comment.