This will give users a good default for files they wish ignored, so they don't have to maintain both a .gitignore and a .projectile with the same content.
Furthermore, it should make it easier to solve https://github.com/bbatsov/projectile/issues/665 by providing some way to override something that was previously ignored in `.gitignore.
I disagree with this as I often have different content in both files.
You can keep having different content in both files. Your use-case won't be damaged by this proposed change.
Just because your next reply won't make much sense (I edited as you were replying):
I may have misunderstand, do you want Projectile to use .gitignore as a .projectile file in case the latter isn't supplied ?
Then I should have settings_local.py in .gitignore, and +/settings_local.py in .projectile. I understand now :j
do you want Projectile to use .gitignore as a .projectile file in case the latter isn't supplied
yes, that way we don't get file suggestions from target/ and build/ and millions of unusable search hits from *.min.js.
It's a sensible default, in my eyes, and if you're adding a .projectile file you can stop ignoring certain files (I can't think of many reasons to do this) and add additional ones to ignore.
:+1:
Ok title mislead me then.
I wouldn't like the 2 files to be merged, but having .gitignore as a default .projectile is a good change.
:+1: for .gitignore as default (but can override with .projectile)
Yes please.
The problem, that you're probably not thinking about, is that it's kind of hard to parse reliably .gitignore - we can definitely handle simple cases, but handling everything supported there would be pretty complex. If someone wants to tackle this - be my guest. I'll definitely don't plan to work on this.
Yeah that's true, though it'd be nice if it did support even the most basic of patterns, ones that directly translate to projectile patterns. That'd cover the majority of the cases for me personally.
Just a thought: why not have git parse the ignore file instead?
git ls-files --others --ignored --exclude-standard --directory
The command above prints a list of the ignored files and directories in the current repo. See discussion here: http://stackoverflow.com/questions/466764/show-ignored-files-in-git
I think having an overriding .projectile file with the default being read with git ls-files is the way to go. As a temporary workaround, I'm switching my search tool to ag because it reads version control ignores and I can execute it through Projectile.
I'm switching my search tool to ag because it reads version control ignores and I can execute it through Projectile.
Sorry to be off topic but you may also be interesseted by ripgrep. There's a projectile-ripgrep command that should be merged in ripgrep.el soon I guess.
@seanirby suggestion is pretty good and we can probably do something along those lines.
I don't have time for this, but I'd gladly review a PR if someone's willing to tackle this.
I just checked, Projectile is honoring .gitignore. I think this can be closed.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!
This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.
Most helpful comment
Just a thought: why not have git parse the ignore file instead?
git ls-files --others --ignored --exclude-standard --directoryThe command above prints a list of the ignored files and directories in the current repo. See discussion here: http://stackoverflow.com/questions/466764/show-ignored-files-in-git