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

Suggestion: .putdocignore #1

Closed
rolfn opened this issue Sep 8, 2017 · 5 comments
Closed

Suggestion: .putdocignore #1

rolfn opened this issue Sep 8, 2017 · 5 comments

Comments

@rolfn
Copy link

rolfn commented Sep 8, 2017

It would be nice to have a configuration file .putdocignore similar to .gitignore containing all files and directories to be ignored. I run in trouble e.g. with editor backup files like myfile.json~. I suppose that the following package can be used for this task: node-ignore Thanks in advance.

@natevw
Copy link
Owner

natevw commented Sep 20, 2017

Thanks for this idea, and for the pull request! Following the .gitignore syntax is reasonable, however, I think it would be better to implement this as .couchappignore (also documented here) instead. I mean not just the format, but also re-use the name.

Not only does this help towards compatibility with existing CouchApps, it's defined as:

a simple json file containing an array of regexps

…so it might not require another dependency, but still be relatively simple to implement inline.

What do you think?

@rolfn
Copy link
Author

rolfn commented Sep 24, 2017

I have no problems with this solution.

@natevw
Copy link
Owner

natevw commented Oct 13, 2017

Hoping to tackle it this afternoon.

Also found couchapp/couchapp#204 while researching some of the details here (can .couchappignore appear in subfolders? what exactly does it match against?)

@natevw
Copy link
Owner

natevw commented Oct 13, 2017

The Python project's handling of .couchappignore is kinda weird to me, it matches in an achored-to-start way, and only against each single path component. This severely limits what it can do, especially compared to the power of gitignore.

Here's my plan:

  • array of regexes like couchapp, but matched against full (relative) path
  • just one .couchappignore (at project root) for now at least

I think this keeps things simple, should be mostly backwards compatible with couchapp in practice, but also adds some putdoc-specific power if people want to use it.

(I'm hoping the Python couchapp could follow suit with the "match against relative path" logic.)

natevw added a commit that referenced this issue Oct 13, 2017
Specifically, this keeps the relative path of files separate from the ddoc_dir root path.
@natevw natevw closed this as completed in 2a5c16e Oct 13, 2017
@natevw
Copy link
Owner

natevw commented Oct 13, 2017

I added .couchappignore support per the comment above.

Published as putdoc@2.0.0 since it's technically a breaking change if excludeDirs was considered public API. (I guess v2 also marks a shift in my thinking from "quick hack upload tool I needed" to "simple tool that can upload most couchapps"… ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants