Project search does not index files in .gitignore


#1

I’m not sure if this is working as intended, but I am unable to open the search with cmd+T and find a file that is ignored by Git. Is this a design decision?


Find in Project yields no results in Homebrew
#2

I’m pretty sure that it is, yes.


#3

You can change that behavior by editing your config file. Or by opening the settings view (cmd-,) and unchecking Exclude VCS Ignored Paths


Fuzzy Finder ignores greyed out files
#4

Thanks for the quick reply. That makes sense.


#5

Has this stopped working? I have 0.115.0 on Mac 10.9.3 installed and it just doesn’t work.


#6

Has what stopped working? Can you be more specific?


#7

Tree View and Fuzzy Finder with VCS ignored paths. I can’t get them to show up (already unchecked the “Exclude Vcs Ignored Paths” option).


#8

I just checked last night when writing this StackOverflow answer and it seems to work just fine. Have you followed the suggestions in the Debugging document? Also, could you give the following information?

  • Which version of Atom are you using?
  • What OS and version are you running?
  • Can you reproduce the issue after completely exiting Atom and restarting using atom --safe?

#9

I had the same problem, I unchecked it in the main settings, but it didn’t show my vendor directory. I had to uncheck it in the tree view package too.

Packages / Tree View

Here is a screenshot


#10

I find that unchecking Exclude VCS Ignored Paths doesn’t affect find-and-replace in project (cmd-shift-f) or fuzzy-finder (cmd-t), and I’m sure it used to in older versions. I’m on OS X, Atom version 1.8.0, find-and-replace version 0.199.0, fuzzy-finder version 1.0.5.

It’s very annoying if I want to do a search across all my code, but it wants to look through my entire node_modules dependencies folders, which are huge and full of irrelevant hits.


#11

@rjmunro I suspect I’ve found where you’re running into problems. If you search for something, then go into the settings view and change the “Exclude VCS Ignored Paths”, then just click the search button again, it will show you the same results. You have to change the search text and execute a new search before the project find results will update.

Here’s what I did:

  1. Open the terminal
  2. Navigate to my local Atom repository
  3. Execute echo "foo foo foo" > node_modules/test.txt
  4. Launch Atom in my local Atom repository
  5. Open Settings View
  6. Ensure that “Exclude VCS Ignored Paths” is checked
  7. Launch Find in Project
  8. Search for “foo foo foo”
  9. Observe that no results are found
  10. Go back to Settings View
  11. Uncheck “Exclude VCS Ignored Paths”
  12. Go back to the Find in Project Panel
  13. Press Enter to search again
  14. Observe that there are no changes
  15. Change the search string to “foo foo” and execute the search
  16. Observe that it finds a bunch of results (including the one in node_modules)
  17. Change the search string to “foo foo foo” and execute the search

At that point, it finds only the file in node_modules.


#12

I’ve just figured it out. If I search the whole project, it ignores the node_modules. If I search a subfolder containing .gitignored content, it includes the .gitignored files. I usually get to find in project by right clicking in the tree view and choosing search in directory. Due to the way our code is structured, I normally only search in one folder, not the whole thing.

It would be great if it could still search if you try to search in a folder that is entirely gitignored, but other than that, I think that .gitignore should be respected when doing any search.

What would be perfect is if there was an “Exclude VCS ignored files” option right in the search, next to the regex, ignore case and whole word options. I’d gladly loose the whole word option for that as I hardly ever use it, and can do a whole word search with a regex, but I do want to search for something in npm’s node_modules, composer’s vendors or a log file or something that is ignored from time to time, but not always.