JetBrains / idea-gitignore

.ignore support plugin for IntelliJ IDEA
Apache License 2.0
1.29k stars 176 forks source link

gitignore scan .gitignore file in ver 1.3 #204

Closed hcf0813 closed 8 years ago

hcf0813 commented 8 years ago

Hi, everytime I open my idea integrated .ignore both to scan all moudles' .gitignore file,lead to my ide too broken and unable to work;At the same time waiting for a long time to unfold the moudle's src etc. image image

Thanks.

alxbauer commented 8 years ago

Same here.

hsz commented 8 years ago

@lovehcf-duplicate @alxbauer Thanks for the quick report. Can you provide me more information about the Project configuration - i.e. submodules, gitignore content, etc - I'll fix it asap.

awerment commented 8 years ago

Also having this issue with a larger codebase. Notable: when opening module directories for the first time after (re)starting the IDE - it takes a couple seconds and my network traffic spikes.

hsz commented 8 years ago

@awerment I do not use any network in my plugin, so it's a different reason of this peak. Can you provide me some information about your IDE, environment, project structure ? Is it public one so I would like to fetch it too ?

awerment commented 8 years ago

Thanks for the super quick reply. Unfortunately this is a closed internal project.

I'm running IntelliJ Ultimate 2016.1, 64bit on Win8.

The project layout is quite chaotic, basically it's one parent module which contains sub-directories - one of which is a nested maven module structure. The other directories contain former eclipse projects (we're migrating, don't ask...), they are not managed as modules in IntelliJ.

After going through some of the old projects, I noticed they themselves contained .gitignore files. After removing them (only one remains for the parent directory), the IDE is usable. But the root issue still seems to remain - opening any module folders for the first time takes longer than it does without the plugin enabled. The network spikes also remain, not sure what's the cause there.

hcf0813 commented 8 years ago

One of gitignores' content is as follows:

image

languanghao commented 8 years ago

I also have same problem after upgrade to v1.3. It cause open floder slow and also make right click menu show slow

bmcclure commented 8 years ago

Same problem here, I think.

Opening pretty much any full Drupal website in PhpStorm is causing the task "Indexing ignore files" to take several minutes, during which time my IDE is almost completely unresponsive.

After the process completes, then the IDE remains very slow and unresponsive for at least 30 seconds more. Finally, after that it seems to work more quickly, though taking any number of actions, such as attempting to commit code to Git, seems to cause the UI to go unresponsive again for several seconds.

This was not an issue at all until the update I just installed to 1.3 today.

pswai commented 8 years ago

I am experiencing the performance impact too after upgrading to 1.3. WebStorm becomes very slow to be usable. Disabling the plugin regains the performance.

z5864703 commented 8 years ago

After updating to 1.3 I also emergence of this issue, the project configuration without any changes. Every time you open phpstorm scans items in all .gitignore, then scanned the entire phpstorm reaction becomes very slow, and then pull the situation becomes more serious

Ornitier commented 8 years ago

Same as @bmcclure here. Can't work on Drupal projects, had to disable .ignore plugin to continue :(

hsz commented 8 years ago

@lovehcf-duplicate @alxbauer @awerment @languanghao @bmcclure @pswai @z5864703 @Ornitier

Can you guys please check if following version fixes this issue ? Remember to unzip this file.

idea-gitignore.zip

z5864703 commented 8 years ago

@hsz Unable to install the plugin. Install plugin from disk ... After the restart phpstorm After the restart widget disappear

hcf0813 commented 8 years ago

@hsz I'm so sorry,unable to install the plugin.Install the plugin from disk and then restart IDE(Android Studio),the widget disappear.

pswai commented 8 years ago

@hsz I am having the same issue. The plugin disappear from the list after restarting WebStorm

vikyd commented 8 years ago

the same problem as @lovehcf-duplicate IDE: PhpStorm .ignore version: 1.3 my project: latest Laravel

hsz commented 8 years ago

@z5864703 @lovehcf-duplicate @pswai @VanDalkvist

Have you unzip this file before and install idea-gitignore.jar file ?

pswai commented 8 years ago

@hsz Installing the jar works! But it gives this error after restarting

7:45:11 PM NullPointerException: mobi.hsz.idea.gitignore.UpdateComponent@4bdffe16

hsz commented 8 years ago

@pswai Ok, please ignore this error for the moment - what about the performance ?

hcf0813 commented 8 years ago

@hsz Thank you for reminding,the jar works.

pswai commented 8 years ago

@hsz Much better. Now it won't make WebStorm completely unusable but the lagginess is still there. I have tried to enable/disable it several times and I can feel the difference. It is especially noticeable when using Go To File function, the autocomplete is lagging with small freeze sometimes.

primeinc commented 8 years ago

Having the same issue, even with the attached jar, PhpStorm 2016.1 on Win 8.1 with Laravel Project. After it's done with the indexing there is a significant lag with just typing/code completion and just about everything else. Phpstorm idle (after indexing) cpu usage is ~6% with the plugin enabled and 0% with it disabled.

Tried to downgrade to 1.2, but get an error

Cannot get state after load
java.lang.NullPointerException
    at mobi.hsz.idea.gitignore.settings.IgnoreSettings.getState(IgnoreSettings.java:145)
    at mobi.hsz.idea.gitignore.settings.IgnoreSettings.getState(IgnoreSettings.java:50)
    at com.intellij.configurationStore.StateGetter.close(StorageBaseEx.kt:57)
    at com.intellij.configurationStore.ComponentStoreImpl.a(ComponentStoreImpl.kt:294)
...
eman1986 commented 8 years ago

I also am experiencing this. Just updated and PhpStorm just crawls, disabling this plugin and its back to being lightning fast.

Really hope this can get resolved, I do enjoy this plugin.

gvlasov commented 8 years ago

I now experience this slowdown with version 1.3.1 of the plugin. The symptoms are the same as in the opening post: loading icon for every .gitignore in the project and massive CPU load. I didn't get this problem before. Not sure what version I had installed, I think it was 1.3.0 that was working fine for me. Disabling the plugin fixed the issue.

Musiksammler commented 8 years ago

I've updated the plugin to version 1.3.1 this morning (linux ubuntu machine) and phpstorm went painfully slow. After disabling the plugin everything worked as before.

hsz commented 8 years ago

Can you guys provide me more information about it ? What is the project structure, how mony ignore files do you have (in subfolders too) ? What is the content of the main .gitignore file ?

Do you have any public project, so I could fetch it ?

I'll try to get as much information as I can and deliver the fix today.

primeinc commented 8 years ago

https://github.com/primeinc/csg-sam is the project I've been working on that has the problems described.

Musiksammler commented 8 years ago

In my case it's a company internal project. Sorry, no public respositories.

A "find . -type f -name ".gitignore" | wc -l" points out a number of 68.

The main .gitgnore looks like this:

.idea/
.mage
__dev
phpinfo.php
composer.lock
/public/images/artikel/
/public/images/cms/brand-**/*.jpg
/public/images/cms/brand-**/*.jpeg
/public/images/cms/brand-**/*.png
/public/images/cms/brand-**/*.gif
/images/cms/brand-**/*.jpg
/images/cms/brand-**/*.jpeg
/images/cms/brand-**/*.png
/images/cms/brand-**/*.gif

# Smarty / Prototype #
######################
/prototype/cache/
/prototype/fonts/
/prototype/stylesheets/
/prototype/images/
/prototype/templates_c/
/prototype/bower_components/
/prototype/node_modules/
/prototype/js/libs
/prototype/js/main.js

/vendor/**/.git
*.min.min.*
bundle.min.js
gvlasov commented 8 years ago

https://github.com/Suseika/tendiwa

Here is the repository I'm having problems with in 1.3.1. It has a lot of submodules with their own .gitignore files. Also, if it might be relevant, in its .gitmodules file, each of 30 submodules has ignore = all option.

vRallev commented 8 years ago

Here is thread dump from Android Studio, if this is helpful: https://code.google.com/p/android/issues/detail?id=205521 Tor Norbye added also a short explanation.

azeos commented 8 years ago

After doing a "File -> Invalidate Caches / Restart" and let the indexing finish, it's working fine. PhpStorm 2016.1 .ignore 1.3.1

gvlasov commented 8 years ago

@azeos Does the whole gitignore thing run again if you restart your IDE?

azeos commented 8 years ago

@Suseika I hadn't tried, but unfortunately yes, the problem reappears

vikyd commented 8 years ago

@azeos , should I Invalidate Caches for all project? because I have more than 10 projects.

azeos commented 8 years ago

@Viky-zhang The problem reappears after you close and open again the application. So, disabling the plugin is the only -apparent- solution. Try that first and may be you don't need to invalidate the caches.

hsz commented 8 years ago

Thank you everyone for the support. I've prepared a fixed version, but before pushing it to the JetBrains repository, I'd like to ask you if you can verify it and confirm that none of above issues appears again.

azeos commented 8 years ago

@hsz Settings -> Plugins -> Install plugin from disk -> idea-gitignore-1.3.1-2040257.jar and I get "Plugin '.ignore' is incompatible with this installation". PhpStorm 2016.1 x64 @ Win7 x64.

gvlasov commented 8 years ago

@azeos Same here. IDEA IC-145.257 x86_64, Debian

hsz commented 8 years ago

Ok, sorry about that - gradle plugin by default limits the IDE versions.

Please install following package (without unzipping - select zip file - this one is 'jar-less' package).

Thanks ! (file removed)

gvlasov commented 8 years ago

@hsz I installed the plugin and restarted the IDE. After it reloaded, I had a massive responsiveness degradation in the IDE with high CPU usage, but without the series of messages notifying that .gitignore files are being processed. After some time the slowdown ended. Then I restarted the IDE, and the same temporary slowdown appears for several minutes after starting.

So the only thing that has changed is that now it doesn't show me the notifications attached in the opening post.

hsz commented 8 years ago

@Suseika I have checked my plugin with profiler tool and it takes just a few % of CPU at the startup so I bet it's not a really caused by the .ignore plugin.

Can you post a CPU snapshot ? Ref. https://intellij-support.jetbrains.com/hc/en-us/articles/207241235-Reporting-performance-problems

gvlasov commented 8 years ago

@hsz Sorry, I can't:

IntelliJ IDEA and PyCharm Community Editions do not include a YourKit profiler agent, because the YourKit agent library is not open-source.

gvlasov commented 8 years ago

@hsz Can you clone the repository I posted above and try to load it in IDEA with the plugin enabled to see if you get any slowdown at startup? The repository has all the necessary project files for IDEA. Make sure to pull all the submodules.

primeinc commented 8 years ago

https://drive.google.com/file/d/0B-3lG2AWxus5SFV3TDVjTWdvUFE/view?usp=sharing

I've attached two snapshots, first one is without the plugin enabled.

Maybe a misconfig is calling git config --global core.excludesfile with no parameters thousands of times.

I don't have a global exclude file setup.

Screenshot: image

primeinc commented 8 years ago

Confirmed Windows workaround:

copy NUL "%USERPROFILE%\.gitignore"
git config --global core.excludesfile "%USERPROFILE%\.gitignore"

Probable? *nix workaround:

touch ~/.gitignore
git config --global core.excludesfile '~/.gitignore'

All performance issues go away, at least with idea-gitignore-1.3.1-3040947

hsz commented 8 years ago

@primeinc That was a bull's-eye. I've prepared a fix. Can you confirm that it fixes the issue?

idea-gitignore-1.3.1-4041002.zip

Please install following package (without unzipping - select zip file - this one is 'jar-less' package). Plugins > Install plugin from disk... > Select downloaded zip package

76200 commented 8 years ago

@hsz this fix seems fine

primeinc commented 8 years ago

yep I ran git config --global --unset core.excludesfile and restarted phpstorm with the plugin active. Works great still. Also tested it with * in my global exclude and it worked as expected. Glad we could track this down.

hsz commented 8 years ago

@primeinc That's a good news! Thank you again for the help in this case.

What about the others? Do you also can confirm the performance improvement?

Musiksammler commented 8 years ago

thumbs-up

Look good!