gitignore_parser
gitignore_parser copied to clipboard
Allow string input rather than a path
Hi,
The premise of this issue is that I want to ignore patterns from .gitignore and .git/info/exclude as well (for local ignores). For performance reasons, it's probably better to use a single matcher for both files.
I noticed in #1 that you don't want to spend time on the project. Would you accept a PR of a small change that adds an function that take a file-like object as argument and does what's in parse_gitignore's with open(): block ?
I'd be open to this, however I don't understand the motivation. Couldn't you just do parse_gitignore('.git/info/exclude', base_dir='.')?
It's for an interactive app where performance matters. Also, from a usability standpoint, it's cumbersome to keep a list of matchers and match paths against each of them. BTW. it's not a great deal, I can abstract this in a method, but we can gain usability and user-freindliness for no price, so I may submit a PR some time.
Okay :)
since I need a quick working solution, I made a fork ... @hermann - I really dont want to make a hostile takeover, but You seem to be busy with other things - so I made a quick fork. I will be happy to pass it back to You after quickly moving forward and stabilisation period.
@lisael - check out https://github.com/bitranox/igittigitt and make Your PRs against that repo, I need to move on quickly.