Skip to content
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

Proper .gitignore support #125

Closed
feross opened this issue Apr 27, 2015 · 17 comments

Comments

@feross
Copy link
Member

commented Apr 27, 2015

This looks like it actually does the trick: https://www.npmjs.com/package/ignore

@tunnckoCore

This comment has been minimized.

Copy link

commented May 21, 2015

Why not just parse gitignore from cwd and then append defaults? And then update them like in the last lines of the index.js which is weird btw, but understandable.

@Flet

This comment has been minimized.

Copy link
Member

commented May 21, 2015

Part of the issue is the gitignore patterns are not the same as minimatch/glob patterns. The ignore package above looks looks like it reconciles these patterns.

@feross feross added the help wanted label May 22, 2015

@feross

This comment has been minimized.

Copy link
Member Author

commented May 22, 2015

PR welcome! The ignore package looks like the way to go.

@jprichardson

This comment has been minimized.

Copy link
Member

commented May 22, 2015

If we do this, could it be done in a 4.0 release as couldn't it be stated that this could violate semver if someone needed to modify their .gitignore file to achieve the same results?

@junosuarez

This comment has been minimized.

Copy link

commented May 28, 2015

@feross

This comment has been minimized.

Copy link
Member Author

commented May 30, 2015

Okay, I have this working. Should it be 3.x or 4.0.0?

@jprichardson The "ignore" property of package.json isn't going away. The .gitignore is purely additive; it's adding new ignored files. That makes me think this should be 3.x. No one's tests should break because of this. When I originally added .gitignore support, it was also done in a minor release.

Anyone have any thoughts (in the next 30 minutes) before I cut this release?

@feross

This comment has been minimized.

Copy link
Member Author

commented May 30, 2015

Well, actually, I have another definitely breaking change (operators go before line break
) I wanted to get into 4.0.0. Might as well just release this change together with that one to be on the safe side.

@feross feross closed this in 6476721 May 30, 2015

@feross

This comment has been minimized.

Copy link
Member Author

commented May 30, 2015

Okay, standard 4.0.0 is released! Enjoy :)

@dcousens

This comment has been minimized.

Copy link
Member

commented May 30, 2015

operators go before line break


Excellent :)

@junosuarez

This comment has been minimized.

Copy link

commented Jun 10, 2015

for the sake of anyone searching back through issues trying to figure out a change in ignore behavior like I was:

in ~3.0.0, package.json "ignore": ["artifacts/"] worked. with this change, in ~4.0.0, it must be "ignore": ["artifacts/**"]

@feross

This comment has been minimized.

Copy link
Member Author

commented Jun 10, 2015

@jden That's odd. "ignore": ["artifacts/"] works just fine for me. What platform are you on? Node version? Standard version?

@junosuarez

This comment has been minimized.

Copy link

commented Jun 10, 2015

@feross on standard@4.0.1

ci *= ~/dev/agilemd/api
 2:21> node -p "require('os').platform() + ' ' + require('os').arch()"
win32 x64

ci *= ~/dev/agilemd/api
 2:21> node -v
v0.10.36

feross added a commit that referenced this issue Jun 10, 2015

@feross

This comment has been minimized.

Copy link
Member Author

commented Jun 10, 2015

@jden I think I know what's causing this, but it's not easy for me to test on Windows.

Can you try using the code on the windows-gitignore-fix branch and see if that fixes the problem for you?

@feross feross reopened this Jun 10, 2015

@junosuarez

This comment has been minimized.

Copy link

commented Jun 11, 2015

@feross I tried that out and get the same behavior. Note, I'm setting my ignores in the "standard" property of the package.json, not in .gitignore.

@feross

This comment has been minimized.

Copy link
Member Author

commented Jun 11, 2015

@jden Yep, I'm aware you're using the standard.ignore property of package.json :) Sorry, I made a silly mistake. Can you try that branch once more?

@junosuarez

This comment has been minimized.

Copy link

commented Jun 11, 2015

@feross yep, confirmed working!

@feross

This comment has been minimized.

Copy link
Member Author

commented Jun 11, 2015

@jden Cool, thanks for the help. I released this fix as 4.1.1. 👍

@feross feross closed this Jun 11, 2015

Flet added a commit to Flet/standard that referenced this issue Oct 23, 2015

Flet added a commit to Flet/standard that referenced this issue Oct 23, 2015

@feross feross added the enhancement label May 10, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
6 participants
You can’t perform that action at this time.