-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
meta: whitelist dotfiles in .gitignore #8016
meta: whitelist dotfiles in .gitignore #8016
Conversation
There are a lot for dot-prefixed files in deeper levels. E.g. in
|
IIRC, filenames without |
@silverwind Exactly. And by blacklisting |
It does seem to work, regardless: $ apply-pr 8016
$ mkdir abc
$ touch abc/.eslintrc
$ touch abc/.dontadd
$ git add --all
$ git status
new file: abc/.eslintrc LGTM once the missing file names are added. |
@silverwind It works only because those files are either already present in git or present in the whitelist. Try: $ git rm ./test/fixtures/.empty-repl-history-file
rm 'test/fixtures/.empty-repl-history-file'
$ touch ./test/fixtures/.empty-repl-history-file
$ git add ./test/fixtures/.empty-repl-history-file
The following paths are ignored by one of your .gitignore files:
test/fixtures/.empty-repl-history-file
Use -f if you really want to add them. This PR should whitelist all the dot-prefixed-files that we already have in git, not just the top-level ones. |
Yes, I agree that's needed. Searching dotfiles in the tree, there might be a few more we ought to include. Or better yet, exclude $ find . -name ".*" | xargs basename | sort | uniq (partially cleaned up)
|
But I don't have Also, I believe that we don't need at least part of those. |
Btw, perhaps we should just whitelist all dot-prefixed files in the deps dir and use a blacklist if appropriate? |
Yeah, those were from my local folder. I cleaned up a few in above list. I think most of the useless files there come from |
I think this should be a more or less complete list of "good" files:
And a list of directories to keep dotfiles from:
|
Nope =) |
👍 for this effort! One thing to consider is that not all IDEs use dotfiles for their files. For example Netbeans (and it's commercial variants, I'd assume) create |
485f7a8
to
2d8ebc5
Compare
@silverwind just updated the file with those, can you take another look? |
We should check that nothing of those was targeted towards the files that are being whitelisted now (i.e. deps/, test/, tools/). |
@ChALkeR Except for EDIT: I also put the dotfile whitelist at the top of the file so all the other |
Instead of excluding IDE-specific dotfiles, exclude all and then whitelist those the project needs to track. Fixes: nodejs#8012
2d8ebc5
to
7dc9f9a
Compare
@claudiorodriguez I don't think we should leave those in, we should rather check where those came from. E.g. |
@ChALkeR fair enough. |
Line I added was to ignore .vs/ directory. Looks like this will continue with proposed changes, so LGTM. |
I haven't tested this out locally just yet so I won't sign off on it but nothing stands out as problematic in the patch. |
Replacing |
Any progress on this? |
Can we get this PR moving forward? Any objections to landing the proposed changes? |
No objections. @nodejs/ctc any objections on this? |
c133999
to
83c7a88
Compare
I'm rebuilding to confirm, but AFAICT, after doing a Granted, this happened before the change, but if we're improving the .gitignore file, why not make it work? As for the change to whitelisting, I'm +0 on it. It supports people who haven't added their editor's temp files to their |
OK, I take #8016 (comment) it back, I can't repro with a completely clean build, I've no idea what happened. |
Bump. This seemed poised to land, but never did. I don't feel strongly about this one either way, but I guess if it means we stop having to evaluate (and typically reject) PRs adding this or that dot-file every now and then, I'm mildly in favor. |
@@ -1,3 +1,19 @@ | |||
# Whitelist dotfiles | |||
.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to use /.*
? I think that way we wouldn't have to whitelist subdirectories below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are meta files from various file managers (e.g. Finder in macOS), IDEs, version control systems, backup systems that can/will create dotfiles in subdirectories.
I think it's easier to whitelist what the Node.js project knows it needs than to react case-by-case to every external product out there.
I think there's no reason not to land it, I'll land in 24 hours if no one objects. |
@claudiorodriguez can you take care of #8016 (comment)? LGTM otherwise. |
@silverwind I didn't remove those since they could still appear in |
Wouldn't the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied without issue (other than a merge conflict solves by 3-way merge), tests pass, all files seem to be there, git status
is clean, anything else holding this up?
Thanks, landed in 15cc7c0. And well, if anything explodes I guess I'm biting the bullet ¯\_(ツ)_/¯ |
Instead of excluding IDE-specific dotfiles, exclude all and then whitelist those the project needs to track. Refs: #8010 Refs: #9111 Refs: #10052 Fixes: #8012 PR-URL: #8016 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
Instead of excluding IDE-specific dotfiles, exclude all and then whitelist those the project needs to track. Refs: #8010 Refs: #9111 Refs: #10052 Fixes: #8012 PR-URL: #8016 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
Instead of excluding IDE-specific dotfiles, exclude all and then whitelist those the project needs to track. Refs: nodejs#8010 Refs: nodejs#9111 Refs: nodejs#10052 Fixes: nodejs#8012 PR-URL: nodejs#8016 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
Instead of excluding IDE-specific dotfiles, exclude all and then whitelist those the project needs to track. Refs: #8010 Refs: #9111 Refs: #10052 Fixes: #8012 PR-URL: #8016 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
Instead of excluding IDE-specific dotfiles, exclude all and then whitelist those the project needs to track. Refs: #8010 Refs: #9111 Refs: #10052 Fixes: #8012 PR-URL: #8016 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
Instead of excluding IDE-specific dotfiles, exclude all and then whitelist those the project needs to track. Refs: #8010 Refs: #9111 Refs: #10052 Fixes: #8012 PR-URL: #8016 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
Instead of excluding IDE-specific dotfiles, exclude all and then whitelist those the project needs to track. Refs: #8010 Refs: #9111 Refs: #10052 Fixes: #8012 PR-URL: #8016 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
Checklist
Affected core subsystem(s)
meta
Description of change
Instead of excluding IDE-specific dotfiles, exclude all and then whitelist those the project needs to track.
Fixes: #8012