Projectile: Projectile won't ignore anything, shows all files at all times

Created on 19 Apr 2013  路  15Comments  路  Source: bbatsov/projectile

In Emacs 24.2, 24.3, or recent source build on Mac OS X with latest projectile.el I am unable to have any files ignored. Have tried projectile-use-native-indexing set to t or nil, in a git repository or a testing project with a .projectile file containing simply "-*.txt" (without quotes, of course). No matter what, when invoking projectile-find-file I am presented with everything git is ignoring and everything listed for ignoring in my .projectile.

The projectile-related portion of my init.el:

(require 'projectile)
(setq projectile-use-native-indexing t)
(setq projectile-enable-caching t)

Is there something I'm not doing right? I've also tried adding (setq projectile-globally-ignored-files (append '("*.txt" "*.o" "*.so") projectile-globally-ignored-files)) to my init.el, have invalidated project cache and reindexed numerous times, with no luck.

Most helpful comment

I don't see why this is closed - I still have this problem using native (projectile's own) indexing on Windows 10.

All 15 comments

I'm using the latest projectile from master(I guess you used MELPA or manual installation?) as well and it the ignore works well for me. In a git repo on a Mac you probably don't need native indexing or caching (unless the project is huge). Requiring projectile should be the only code you need.

I was using MELPA, but removed that and installed the latest from git this morning and the issue was gone (after invalidating the cache). The issue was present whether my init.el contained only (require 'projectile) or also included the native and/or caching values, but I guess that was just a MELPA thing?

Screen Shot 2013-04-22 at 11 07 27 AM

I have the same problem. I have a clojure project, added the following .projectile file to the root of the project directory, and all class files are shown upon C-c p f. Also Mac OSX, no caching options set.

-/.DS_Store
-/.lein-repl-history
-/TAGS
-/target

When byte-force-recompile the files I get:

^L
Compiling file /Users/uwe/.emacs.d/elpa/projectile-0.8/projectile-pkg.el at Mon Apr 22 21:47:37 2013
^L
Compiling file /Users/uwe/.emacs.d/elpa/projectile-0.8/projectile.el at Mon Apr 22 21:47:37 2013

In projectile-grep:
projectile.el:397:153:Warning: reference to free variable
    `grep-find-ignored-directories'
projectile.el:398:123:Warning: reference to free variable
    `grep-find-ignored-files'

Currently .projectile is consulted only when you're using native indexing. In it's default mode of operation Projectile will take into account only .gitignore, .hgignore, etc.

My .gitignore file, sitting in the project root dir, lists the following:

.DS_Store
.lein-repl-history
TAGS
/target

(In Clojure/Leiningen, all .class files sit in the target dir). Thus, all .class files should be ignored, but aren't.

And activating (setq projectile-enable-caching t) did also not make projectile exclude any files in the .projectile exclusion list.

Furthermore I can't find any reference to .gitignore in the source code. Is this meant to be part of a side-effect of using a grep/ack tool?

After removing the 0.8 and installing the latest git version, exclusion (both from .gitignore and .projectile) works fine. Cool!

I am having the same issue. What does "Currently .projectile is consulted only when you're using native indexing." mean?

I want to ignore the apps/ folder which is in the git repository, BUT I don't want it to be in .gitignore. Is that possible? Or does it only look at .gitignore?

Never mind, this is a common issue, my apologies for not looking through more of the issues. (you must enable native indexing.)

I cannot get projectile to ignore any files. I have tried every method in these comments and I've not been able to get it to ignore any file.

(setq projectile-globally-ignored-files '( "TAGS" "*.txt" "*.~undo-tree~" ))

does nothing, and adding a .projectile file does nothing

I tried the MELPA version and git master as of just now

If anyone has any ideas, I'd appreciate it. I would really like to use projectile but right now it is very frequently offering me undo-tree files and such.

actually its native indexing that breaks things for me on Windows... the 'alien indexing takes .gitignore into account but native doesn't.

I don't see why this is closed - I still have this problem using native (projectile's own) indexing on Windows 10.

I'm having this issue on Linux using alien indexing. Neither .projectile nor .gitignore works

I am having this problem as well on OSX High Sierra. I've tried using the customize interface, using ag, even switching my default completion engine to ivy and NOTHING works. It's very annoying to get results back from node_modules when searching through my projects.

I solved this problem by deleteing ~/.emacs.d/projectile.cache

and add node_modules to ignored directories and to .gitignore

and it will works

Make sure you're actually in a git repository. With the alien method, projectile runs git ls-files -zco --exclude-standard to figure out which files to show. Running that in the shell can help you narrow down where the issue lies.

Was this page helpful?
0 / 5 - 0 ratings