Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected ignore coloring of nested file listed as a top level ignore only #112

Closed
Cervator opened this issue Apr 21, 2015 · 7 comments
Closed
Labels

Comments

@Cervator
Copy link

Just noticed this - I have "gradle.properties" in my .gitignore, which is a root level file and not controlled by Git in this case. However I also have a template version of the file in a nested directory that is in Git. The plugin marks the nested version as ignored, yet Git reports it as changed (which is what I expect - in this case I have a pending change in it). I would think the nested gradle.properties at this point should be highlighted in blue, which it becomes if I take out the entry in the .gitignore.

Example:

gitignore

Incidentally the .gitignore inside the templates directory naturally is itself a template and doesn't have a gradle.properties entry in it.

I'm not entirely sure how to get gradle.properties at any location gitignored just to see what happens, but then I don't need that either so that's ok :-)

@hsz
Copy link
Member

hsz commented Apr 24, 2015

@Cervator I think, it's strongly connected to the issue #105 - it will reset the ignore scope if nested repository appears - so it will not ignore

templates/gradle.properties

file as well.

If I'll prepare some RC build - could you test it and confirm taht it works well ?

@Cervator
Copy link
Author

Sure, just let me know how :-)

@hsz
Copy link
Member

hsz commented Apr 24, 2015

Great. It's available here: https://github.com/hsz/idea-gitignore/releases/tag/v1.1.2-RC

@Cervator
Copy link
Author

Good news / bad news. With that RC #105 appears fixed, but the gradle.properties in a subdir is still being ignored. Just to clarify this is not a nested Git root, just a plain ole boring subdir :-)

2015-04-24 13_27_55-terasology - c__dev_terasology_git_integrate_terasology - terasology - _t

In that screenshot Core and CoreSampleGameplay are in the root repo and Sample is its own nested root. So that looks right.

For reference the parent repo with the gradle.properties is https://github.com/MovingBlocks/Terasology (the copy at the root was manually duplicated from the template, no magic involved)

For completeness here's the content of the template .gitignore (which shouldn't be in play at all since it is not in a Git root, and it doesn't have any related entries)

# Modules get a copy of build.gradle as they are not allowed to have their own (for build security / sandboxing)
build.gradle

# IntelliJ
*.iml

# Eclipse
.checkstyle
.classpath
.project
.settings
bin/
build/

@hsz hsz added the bug label Apr 26, 2015
@hsz
Copy link
Member

hsz commented Apr 26, 2015

With following command:

find . | git check-ignore --verbose --no-index --stdin

you can check what files are mathed by the .gitignore rules in your repository.

As I can see, the templates/gradle.properties file was added to the repository before ignoring gradle.properties rule or added with --force switch.

Currently, VCS files index is not respected by the plugin. It's using only the rules from ignore files.

@Cervator
Copy link
Author

Ooohh. So you mean that file would normally have been ignored, but since it already exists in the repo what git returns on the command line clashes with how it ideally should work?

Yeah it is entirely possible if not probable that entry was added to the ignore later. My apologies for the inconvenience in that case :-)

@hsz hsz closed this as completed May 11, 2015
@hsz
Copy link
Member

hsz commented May 11, 2015

Fix has ben released just right now with v1.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants