appnexus / sicksync

Don’t accept the available as the preferable. Go the extra mile with extra speed.
Apache License 2.0
68 stars 11 forks source link

Read `.gitignore` for excludes #34

Closed joelgriffith closed 7 years ago

laggingreflex commented 7 years ago

Fixed in #46

laggingreflex commented 7 years ago

This doesn't yet work exactly like .gitignore. While the gitignore files are parsed correctly, chokidar's ignored option works slightly differently that git's mechanism of ignoring paths from gitignore.

For example it doesn't work on a deeper level. If you have .cache in your .gitignore and src/something/.cache it won't be ignored. It'll only ignore ./cache (from root)

This has come up before too in #47 but I think this particular detail was missed earlier.

I think at least a warning should be added that while sicksync does parse gitignore it doesn't work exactly like it.

Or it should try to make it work? In the above example if I wanted .cache to be ignored a level deeper I'd have to make the rule **/.cache/**, so should it just add **/ before every gitigore rule? I remember I made a PR for doing exactly this in https://github.com/paulmillr/chokidar/pull/539 but, at least from chokidar's perspective, it might not have been a good idea.

What would be the best approach?

laggingreflex commented 7 years ago

This also doesn't work for bigSync (at all, not just the issue in above comment)

edit: fixed in #89