Skip to content

tools,build: .gitignore tweaks #17380

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 22 additions & 44 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Whitelist dotfiles
.*
!deps/**/.*
!test/fixtures/**/.*
!tools/eslint/**/.*
!tools/doc/node_modules/**/.*
!deps/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this would trump #17363

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check. exclusion rules seem to be tricky (CSS style), but I think these are stronger:

node/.gitignore

Lines 111 to 120 in a84f58d

# npm stuff
node_modules
package-lock.json
!/deps/npm/node_modules**
/deps/npm/node_modules/node-gyp/gyp/**/*.pyc
!/tools/eslint/node_modules**
!/tools/doc/node_modules**
!/test/fixtures/**
# not needed and causes issues for distro packagers
/deps/npm/node_modules/.bin/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it at the very least be at the bottom to avoid other rules combatting it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I saw while testing is that most of the rules below apply for /deps (only conflict is debug/release), so IMO it makes sense to keep it up here.

!.editorconfig
!.eslintignore
!.eslintrc.yaml
!.eslintrc.yml
!.gitattributes
!.github
!.gitignore
Expand All @@ -24,9 +22,8 @@ perf.data.old
tags
.lock-wscript
*.pyc
doc/api.xml
/doc/api.xml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean why was this not an absolute path? This PR makes it one right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made all relative paths absolute, since we have all sorts of path patterns deeper in the tree.

tmp/
test/tmp*/
iojs
iojs_g
node
Expand All @@ -36,16 +33,13 @@ node_g
icu_config.gypi
.eslintcache
node_trace.*.log
coverage/

/coverage/
/out
*.tap

# various stuff that VC++ produces/uses
Debug/
!**/node_modules/debug/
!deps/v8/src/debug/
Release/
!doc/blog/**
*.sln
!nodemsi.sln
*.suo
Expand All @@ -62,59 +56,43 @@ ipch/
*.VC.opendb
.vs/
.vscode/
/deps/v8/src/debug/obj
/*.exe

/config.mk
/config.gypi
/config_fips.gypi
config.mk
config.gypi
config_fips.gypi
icu_config.gypi
*-nodegyp*
/gyp-mac-tool
/npm.wxs
/tools/msvs/npm.wixobj
/tools/msvs/genfiles/
/test/addons/??_*/
email.md
deps/v8-*
deps/icu
deps/icu*.zip
deps/icu*.tgz
deps/icu-tmp
./node_modules
android-toolchain/
.svn/
*.target.mk
*.host.mk

# generated by gyp on Windows
deps/openssl/openssl.props
deps/openssl/openssl.targets
deps/openssl/openssl.xml

# generated by gyp on android
/*.target.mk
/*.host.mk
deps/openssl/openssl.target.mk
deps/zlib/zlib.target.mk

# not needed and causes issues for distro packagers
deps/npm/node_modules/.bin/
!doc/blog/**

# build/release artifacts
/*.tar.*
/*.pkg
/SHASUMS*.txt*

# test artifacts
tools/faketime
tools/remark-cli/node_modules
tools/remark-preset-lint-node/node_modules
icu_config.gypi
*.tap
/tools/faketime
/test/addons/??_*/

# Xcode workspaces and project folders
*.xcodeproj
*.xcworkspace

# libuv book and GitHub template
deps/uv/.github/
deps/uv/docs/code/
deps/uv/docs/src/guide/
# npm stuff
node_modules
package-lock.json
!/tools/eslint/node_modules**
!/tools/doc/node_modules**
!/test/fixtures/**

# more patterns in /deps/.gitignore
29 changes: 29 additions & 0 deletions deps/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
!/v8/test/debugger/debug/
!/v8/src/base/debug
!/v8/src/debug
/v8/src/debug/obj

!/v8/tools/release

/v8-*
/icu
/icu*.zip
/icu*.tgz
/icu-tmp

# generated by gyp on Windows
/openssl/openssl.props
/openssl/openssl.targets
/openssl/openssl.xml

!/npm/node_modules**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be !/npm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the other files in /deps/npm aren't ignores by any other rule, only node_modules is. So this is the minimal glob needed.

/npm/node_modules/node-gyp/gyp/**/*.pyc
# not needed and causes issues for distro packagers
/npm/node_modules/.bin/

# libuv book and GitHub template
/uv/.github/
/uv/docs/code/
/uv/docs/src/guide/

!/v8/test/**log