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 237212 - Netbeans shouldn't even attempt to parse .hgignore
Summary: Netbeans shouldn't even attempt to parse .hgignore
Status: NEW
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-16 16:51 UTC by AE56
Modified: 2013-10-17 15:04 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description AE56 2013-10-16 16:51:33 UTC
Netbeans should not be attempting to parse the .hgignore file AT ALL.  Instead it should determine a file's ignore status using hg status commands, (i.e. `hg status -A`.

There is a LOT of subtlety in how the .hgignore file works and it's relationship to a project, which is very much outside the scope of what netbeans should be doing.

Using `hg status -A` is much simpler and more accurate.
Comment 1 Ondrej Vrabec 2013-10-16 20:14:50 UTC
... and much slower, yes
Comment 2 AE56 2013-10-16 20:26:46 UTC
(In reply to Ondrej Vrabec from comment #1)
> ... and much slower, yes

Slower might be a little better than broken. 

But, I have trouble believing this would slow things down significantly. Where is the delay? Isn't there already a process periodically doing `hg st` to determine modification status?
Comment 3 Ondrej Vrabec 2013-10-16 20:30:43 UTC
(In reply to AE56 from comment #2)
> Slower might be a little better than broken. 
Broken? Where? For the past several years i haven't crossed any situation when we applied .hgignore incorrectly.
> But, I have trouble believing this would slow things down significantly.
> Where is the delay? Isn't there already a process periodically doing `hg st`
> to determine modification status?
Sure there is. But that command does not list ignored files and *does not traverse* ignored folders so effectively makes things much much faster. Try running 'hg status' and 'hg status -i' on NetBeans repository with build sources (so you have thousands of ignored files across /build folders)
Comment 4 AE56 2013-10-16 21:19:18 UTC
(In reply to Ondrej Vrabec from comment #3)
> (In reply to AE56 from comment #2)
> > Slower might be a little better than broken. 
> Broken? Where? For the past several years i haven't crossed any situation
> when we applied .hgignore incorrectly.

It is not applied correctly in my project, as described in https://netbeans.org/bugzilla/show_bug.cgi?id=231516

I believe this has been a problem since I've been using netbeans (I started at 7.1).  I do not believe I am the only one with this issue.

> > But, I have trouble believing this would slow things down significantly.
> > Where is the delay? Isn't there already a process periodically doing `hg st`
> > to determine modification status?
> Sure there is. But that command does not list ignored files and *does not
> traverse* ignored folders so effectively makes things much much faster. Try
> running 'hg status' and 'hg status -i' on NetBeans repository with build
> sources (so you have thousands of ignored files across /build folders)

Why does netbeans run 'hg status' at the hg-root level?
Comment 5 Ondrej Vrabec 2013-10-17 07:34:18 UTC
(In reply to AE56 from comment #4)
> It is not applied correctly in my project, as described in
> https://netbeans.org/bugzilla/show_bug.cgi?id=231516
I believe it is. Your files are most likely ignored because another part of the IDE says it should be ignored. The project owner marks certain files as NOT_SHARABLE (to be ignored by version control). Such files and folders usually are private project metadata, build/dist folders etc. For some reason C++ project hierarchy marks your ordinary files as ignored. No idea why.

> Why does netbeans run 'hg status' at the hg-root level?
When you open the root folder in the IDE (mount it to Favorites foe example), we have no choice but to scan the whole repo.
Comment 6 AE56 2013-10-17 15:04:41 UTC
(In reply to Ondrej Vrabec from comment #5)
> (In reply to AE56 from comment #4)
> > It is not applied correctly in my project, as described in
> > https://netbeans.org/bugzilla/show_bug.cgi?id=231516
> I believe it is. Your files are most likely ignored because another part of
> the IDE says it should be ignored. The project owner marks certain files as
> NOT_SHARABLE (to be ignored by version control). Such files and folders
> usually are private project metadata, build/dist folders etc. For some
> reason C++ project hierarchy marks your ordinary files as ignored. No idea
> why.

Ignoring issues covered separately by that bug report, consider this contrived example:

A developer has a project called Foo under mercurial and Foo builds in Foo/build. His .hgignore has a glob expression like */build to ignore all build directories.  A custom pre-compile tool makes a derived.h file in the build directory.  Mercurial and netbeans will call derived.h ignored, correctly.  Now, the developer manually hg adds derived.h. This file is no longer ignored by mercurial, but netbeans will continue to mark this as if it is ignored. This is because there is no way to parse .hgignore that will discover this file.

I'm not arguing that this is a good idea, but I could see someone attempting this.

> > Why does netbeans run 'hg status' at the hg-root level?
> When you open the root folder in the IDE (mount it to Favorites foe
> example), we have no choice but to scan the whole repo.

I just looked at the Favorites pane for the first time.  Why is my home folder there?? Clearly I do not understand the utility of this pane.