Idea-gitignore: Plugin shows incorrect information

Created on 11 Apr 2019  路  12Comments  路  Source: JetBrains/idea-gitignore

Prerequisites

  • [x] Plugin is in the latest version
  • [x] Issue was not reported yet
  • [ ] Stack trace (if provided) contains mobi.hsz.idea.gitignore package name

Description

The plugin is over-riding the Git ignore data or getting it wrong. Files that should be tracked are showing as ignored in the IDE when this plugin is enabled.

Steps to Reproduce

  1. Create a new project
  2. Create a directory, parent
  3. Create a subdirectory under parent, notignored
  4. Create a subdirectory under notignored, subdirectory
  5. Put a file called test.txt in both notignored and subdirectory
  6. Put the following codeblock in .gitignore in the parent directory
# Exclude everything
*
!.gitignore

# Whitelist include
!notignored
!notignored/**

Expected behavior:

The plugin should show the correct ignored information as per Git

Actual behavior:

Files that are not ignored by Git are showing as ignored in the Project view AND in the banner when editing the files.

Turning the plugin off restores the expected behaviour. Since I need accurate information in the files more than I need the auto-creation, I've disabled the plugin.

Reproduces how often:

100% of the time

Versions

Plugin:

v2.6.2

IDE:

PhpStorm 2019.1

OS:

Mac 10.14.4

Additional Information

Screenshot showing this in action.

gitignore-plugin-error

edit 1: Fixed the checkbox display

bug ready for release

Most helpful comment

All right, thanks n
Let's create a new ticket for that then.

All 12 comments

image

image

The "not"s seem to not work.

I used the plugin to ignore .ivy and to un-ignore the 2 xml files. Your plugin created the ignore entries, yet it still complains about them!

@benfreke Thank you for this report! It appeared that double star at the end didn't match _everything_ that comes after the previous pattern - but it should.
Problem is fixed and will be available in v3.1.1.

@dailytabs You're referring to the very different thing. Anyway, this feature has been removed with upcoming release: https://github.com/hsz/idea-gitignore/issues/486#issuecomment-490740469

Fixed and released with v3.1.1

@hsz I'm on 3.1.1.191 just downloaded maybe 15 mins ago and PhpStorm thinks everything is ignored inside /src.

Is this the same or a different problem?
Screen Shot 2019-05-13 at 12 18 05 PM

@SkylerLS That's a plot twist. Can you please share your .gitignore?

Heh.

Sure. The top-level .gitignore is as follows:

.idea
.idea.bak
.env
docker/.volumes
**/secrets/*.yaml
infection-log.txt

The .gitignore inside /src is

/public/hot
/public/storage
/storage
/vendor
/.idea
/.env
/_ide_helper.php

Then some others in deeper layers too.

@SkylerLS I've created .gitignore files in the same way, but it behaves correctly and doesn't mark all of the content with gray.

Let's try with:

  • adding empty lines in every .gitignore file and manually save with Ctrl+S
  • File > Invalidate & Restart

It was looking for a moment like it would work while the index was being rebuilt. But it didn't work.

@SkylerLS van you please prepare a minimal project example that can reproduce this behaviour?

I'll update here when I can find the time to do that. Likely Wednesday or Thursday of this week.

All right, thanks n
Let's create a new ticket for that then.

I just wanted to comment and say that my original issue is solved with the latest release. Thanks for the fix!

Was this page helpful?
0 / 5 - 0 ratings