This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 243498

Summary: Gitignore options are not taken into account
Product: versioncontrol Reporter: alumni
Component: GitAssignee: Ondrej Vrabec <ovrabec>
Status: NEW ---    
Severity: normal CC: git, reinouts
Priority: P4    
Version: 8.0   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description alumni 2014-04-02 23:11:15 UTC
The following lines from my .gitignore file are not taken into account:

# IDE settings
{,*/}nbproject/
# Compiled/optimized scripts
{,**/}*.py{c,o}

Netbeans automatically adds these files to version control, despite my settings. The command line git client ignores them (expected behaviour)


Product Version = NetBeans IDE 8.0 (Build nbms-and-javadoc-1507-on-20140402)
Operating System = Linux version 3.13.7-1-ARCH running on amd64
Java; VM; Vendor = 1.8.0
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.0-b70
Comment 1 Ondrej Vrabec 2014-04-03 06:28:32 UTC
I understand double '*', but what about {,}? JGit simply does not support everything from glob patterns, it merely tries to keep track with what is stated in git help ignore. See also bug #242551 for double asterisks pattern.
The only advise i can give you is not to use {,}.
Comment 2 alumni 2014-04-09 15:15:06 UTC
I was using glob patterns before with the commandline git client, so when I switched the project to Netbeans, I was expecting it to support them too...

Anyway, here's some other pattern that doesn't work for me (might be related to the ** issue):

The file I need to ignore is /project/app/settings/local.py

The following patterns won't work:

    settings/local.py (works with regular git)
    **/settings/local.py
    /**/settings/local.py

But the following will:

    /*/*/settings/local.py
Comment 3 alumni 2014-04-09 16:03:49 UTC
my bad, "settings/local.py" doesn't work with regular git, but "**/settings/local.py" does.
Comment 4 rptmaestro 2014-05-20 17:05:18 UTC
I have a similar issues. Here are my settings:

# Ignore build folders
**/target

# Ignore Netbeans Maven extensions
**/nbactions*.xml
**/nb-configuration.xml


From the command-line, I run:

git add --all
git status

The output correctly ignores these files.

./nbactions.xml
.some/nested/project/nb-configuration.xml

However, when I run "Git > Show Changes", NetBeans displays both of these files with the status of "-/Added".

Moreover, many times after working on int my repository, Netbeans will insert entries for every target folder in my Maven project hierarchy. For example:

target
some/nested/project/target
some/other/project/target
foo/bar/target
Comment 5 reinouts 2014-06-11 15:46:38 UTC
Possible duplicate of issue #242551 as well?
Comment 6 Ondrej Vrabec 2014-06-11 15:51:12 UTC
(In reply to reinouts from comment #5)
> Possible duplicate of issue #242551 as well?
This one covers also {} patterns and the full fnmatch syntax which i think will not be fixed in JGit any time soon. On the other hand ** might come sooner so better to keep the issues separated