Received notice that
Ignored files found that are tracked: .ignore plugin found some files that are tracked with Git which are also listed in .gitignore file.
However, the file being highlighted is gradle-wrapper.jar which is in my .gitignore file as this:
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
Earlier I also noticed that log4j2.properties file which is in my build folder was similarly being marked. It is of course included in git in the main project, and my build folder is added to .gitignore, so this rule seems a little confused.
I noticed very similar behaviour across several projects. In one case, my project root (directory!) is being detected as being tracked and ignored at the same time by the plugin. Obviously, my project root directory is not included in .gitignore.
@akomelj Thank you for your report!
When displaying those kind of informations, I'm depending on the following git command:
git ls-files --ignored --exclude-standard
performed in each Git root directory.
This command provides me a list of the files (relative paths to the git-root) that are listed in .gitignore file AND tracked by git (so, they were added to Git repo before a rule was added to the .gitignore).
Can you plase execute this command in your git roots and provide me the output to help on the issue investigation?
$ git ls-files --ignored --exclude-standard
gradle/wrapper/gradle-wrapper.jar
$ cat .gitignore
...
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
...
Interesting, I thought I'd try something quickly - and apparently its all git's fault.
If I edit my .gitignore I can avoid this issue...
Previously:
$ cat .gitignore
...
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
...
# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
...
$ git ls-files --ignored --exclude-standard
gradle/wrapper/gradle-wrapper.jar
$
Edited, I end up with this:
$ cat .gitignore
...
# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
...
$ git ls-files --ignored --exclude-standard
$
Previously the Avoid line was placed before the *.jar line
So the order is apparently very important
(Hope that makes sense)
@hsz
The provided command does not list HWE directory (supposedly ignored & tracked):
netek:epay-hwe andrej$ git ls-files --ignored --exclude-standard
MODULES/business_portal/src/main/resources/static/components/qr/.DS_Store
MODULES/issuer_portal/src/main/resources/static/css/.DS_Store
MODULES/modules-furs/src/test/resources/.DS_Store
MODULES/sessionmodule/web/src/main/webapp/META-INF/MANIFEST.MF
MODULES/sessionmodule/web/src/main/webapp/META-INF/context.xml
MPS/StatusImporter/.factorypath
WEBAPP/overlays/rs/ebills/admin/src/main/webapp/static/js/views/.gitignore
WEBAPP/overlays/rs/ebills/portal/src/main/webapp/static/js/views/.gitignore
.gitignore in the root of Git repo and in HWE project directory (direct descendant of the root of Git repo) also does not list HWE as excluded:
netek:epay-hwe andrej$ cat .gitignore
# Compiled source #
target/
build/
bin/
.metadata
.settings/
.apt_generated/
.project
.classpath
.factorypath
.idea/
.codepro/
*.iml
/log/
*.log
pom.xml.versionsBackup
netek:epay-hwe andrej$ cat HWE/.gitignore
cat: HWE/.gitignore: No such file or directory
Since my project root HWE is not in the root of Git repo - is it possible that your plugin processes Git output and wants to display descendants of HWE which are not listed and displays only empty project root directory as a result?
Plugin dialog screenshot:

before press "add unversioned files": https://habrastorage.org/files/559/1e1/17a/5591e117a1374d34a56f4718a670e38b.png
after press: https://habrastorage.org/files/9bb/243/ab5/9bb243ab5287461c8557eeff4d9dcdeb.png
command "git ls-files --ignored --exclude-standard" no output
UPD: I think that the plug-in sees the files and directories that are created IDEA for internal needs and then removed. the problem is probably in IDEA virtual file system
I'm having the same issue:

.gitignore:
.idea
!.idea/codeStyleSettings.xml
@SUPERCILEX I had the exact same match coming up.
To work around the issue, I changed .idea to .idea/**/*.*
It matches everything inside the .idea folder without having to match on a directory level, which apparently causes git to trip up.
@HeadOnAPlate Thanks for the tip! .idea/**/*.* didn't work for me, but this did: .idea/**. That's weird that git can't do this for us. Anyway, thanks!
I've seen this problem elsewhere: https://github.com/joeblau/gitignore.io/issues/178
It does appear that order matters in the .gitignore file. Is there a way we could separate the exclusions from templates and include them at the end of the file, maybe after some marker where newly added templates would be placed? Or maybe have the inclusive portion of templates added to the top of the file and exclusionary portions of templates added to the end?
I'm experiencing false positives on several projects where the plugin is reporting that it found files which are tracked in Git but are listed in .gitignore, yet the "list of commands to be performed with untrack operation" is empty, and git ls-files --ignored --exclude-standard also does not produce any results.
@rscorer @akomelj @bamapookie @SUPERCILEX @HeadOnAPlate @bamapookie @pbienick
Thank you guys for this feedback.
I finally was able to resolve this issue (mostly with reimplementing the indexing part). The main issue that caused this bug was wrongly handled files excluding with ! at the beginning (it was commited to #350).
This fix will be released with v2.0.0 as soon as I'll take care of the other issues (I'm back on track for last 2 weeks).
CC @cjbarth @pvannuff @bamapookie @Hronom
Most helpful comment
@rscorer @akomelj @bamapookie @SUPERCILEX @HeadOnAPlate @bamapookie @pbienick
Thank you guys for this feedback.
I finally was able to resolve this issue (mostly with reimplementing the indexing part). The main issue that caused this bug was wrongly handled files excluding with
!at the beginning (it was commited to #350).This fix will be released with v2.0.0 as soon as I'll take care of the other issues (I'm back on track for last 2 weeks).
CC @cjbarth @pvannuff @bamapookie @Hronom