{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/8247","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/8247/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/8247/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/8247/events","html_url":"https://github.com/nodejs/node/issues/8247","id":172868947,"number":8247,"title":"npmignore glob patterns broken or documented incorrectly","user":{"login":"binki","id":82626,"avatar_url":"https://avatars.githubusercontent.com/u/82626?v=3","gravatar_id":"","url":"https://api.github.com/users/binki","html_url":"https://github.com/binki","followers_url":"https://api.github.com/users/binki/followers","following_url":"https://api.github.com/users/binki/following{/other_user}","gists_url":"https://api.github.com/users/binki/gists{/gist_id}","starred_url":"https://api.github.com/users/binki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binki/subscriptions","organizations_url":"https://api.github.com/users/binki/orgs","repos_url":"https://api.github.com/users/binki/repos","events_url":"https://api.github.com/users/binki/events{/privacy}","received_events_url":"https://api.github.com/users/binki/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-24T05:41:34Z","updated_at":"2016-08-24T05:48:23Z","closed_at":null,"body":"* **Version**: v6.4.0\r\n* **Platform**: MSYS_NT-10.0 DESKTOP-A4G2C0J 2.5.0(0.294/5/3) 2016-03-01 13:48 x86_64 Msys\r\n* **Subsystem**: npm\r\n\r\nLet’s say I have a folder with a bunch of files which should be excluded when I `npm pack`:\r\n\r\n```\r\nohnob@DESKTOP-A4G2C0J  ~/repos/testnpm\r\n$ ls -la\r\ntotal 29\r\n-rw-r--r-- 1 ohnob ohnob   1 Aug 24 01:26 #blah#\r\ndrwxr-xr-x 1 ohnob ohnob   0 Aug 24 01:28 .\r\n-rw-r--r-- 1 ohnob ohnob  37 Aug 24 01:26 .#blah\r\ndrwxr-xr-x 1 ohnob ohnob   0 Aug 24 01:18 ..\r\ndrwxr-xr-x 1 ohnob ohnob   0 Aug 24 01:29 .git\r\n-rw-r--r-- 1 ohnob ohnob  30 Aug 24 01:28 .gitignore\r\n-rw-r--r-- 1 ohnob ohnob  10 Aug 24 01:24 .gitignore~\r\n-rw-r--r-- 1 ohnob ohnob  77 Aug 24 01:24 package.json\r\n-rw-r--r-- 1 ohnob ohnob  77 Aug 24 01:24 package.json~\r\n-rw-r--r-- 1 ohnob ohnob   9 Aug 24 01:27 README.md\r\n-rw-r--r-- 1 ohnob ohnob  14 Aug 24 01:27 README.md~\r\n-rw-r--r-- 1 ohnob ohnob 302 Aug 24 01:28 testnpm-0.0.0.tgz\r\n```\r\n\r\nSo I set up a `.gitignore` for them which `git` respects just fine:\r\n\r\n```\r\nohnob@DESKTOP-A4G2C0J  ~/repos/testnpm\r\n$ cat .gitignore\r\n*#*\r\n*~\r\nnode_modules\r\n*.tgz\r\n\r\nohnob@DESKTOP-A4G2C0J  ~/repos/testnpm\r\n$ git status -s\r\n?? .gitignore\r\n?? README.md\r\n?? package.json\r\n```\r\n\r\nBut when I use `npm pack`, I see that the `*~` pattern is ignored as `README.md~` ends up in the packged package:\r\n\r\n```\r\nohnob@DESKTOP-A4G2C0J  ~/repos/testnpm\r\n$ npm pack\r\ntestnpm-0.0.0.tgz\r\n\r\nohnob@DESKTOP-A4G2C0J  ~/repos/testnpm\r\n$ tar -tvzf testnpm-0.0.0.tgz\r\n-rw-rw-rw- 0/0              77 2016-08-24 01:24 package/package.json\r\n-rw-rw-rw- 0/0              30 2016-08-24 01:28 package/.npmignore\r\n-rw-rw-rw- 0/0               9 2016-08-24 01:27 package/README.md\r\n-rw-rw-rw- 0/0              14 2016-08-24 01:27 package/README.md~\r\n\r\n```\r\nI can even tell that `npm pack` is at least interpreting the `.gitignore` as `.npmignore` as expected.\r\n```\r\nohnob@DESKTOP-A4G2C0J  ~/repos/testnpm\r\n$ tar -xOzf testnpm-0.0.0.tgz package/.npmignore\r\n*#*\r\n*~\r\nnode_modules\r\n*.tgz\r\n\r\n```\r\n\r\nIt seems like [the following assertion](https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package) is incorrect:\r\n\r\n> .npmignore files follow the [same pattern rules](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#Ignoring-Files) as .gitignore files:\r\n>\r\n> * Blank lines or lines starting with # are ignored.\r\n> * Standard glob patterns work."},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/241963860","html_url":"https://github.com/nodejs/node/issues/8247#issuecomment-241963860","issue_url":"https://api.github.com/repos/nodejs/node/issues/8247","id":241963860,"user":{"login":"binki","id":82626,"avatar_url":"https://avatars.githubusercontent.com/u/82626?v=3","gravatar_id":"","url":"https://api.github.com/users/binki","html_url":"https://github.com/binki","followers_url":"https://api.github.com/users/binki/followers","following_url":"https://api.github.com/users/binki/following{/other_user}","gists_url":"https://api.github.com/users/binki/gists{/gist_id}","starred_url":"https://api.github.com/users/binki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binki/subscriptions","organizations_url":"https://api.github.com/users/binki/orgs","repos_url":"https://api.github.com/users/binki/repos","events_url":"https://api.github.com/users/binki/events{/privacy}","received_events_url":"https://api.github.com/users/binki/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T05:48:23Z","updated_at":"2016-08-24T05:48:23Z","body":"I even tried running `dos2unix .gitignore` before running `npm pack` just in case that could affect it. Made no difference. I also get the same issue on Linux with node v4.4.7."}}
{"actor":{"display_login":"binki"}}