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

Ignoring directories #33

Open
TomKemperNL opened this issue Oct 9, 2016 · 5 comments
Open

Ignoring directories #33

TomKemperNL opened this issue Oct 9, 2016 · 5 comments

Comments

@TomKemperNL
Copy link
Contributor

Currently directories with only ignored files are showed as empty directories.
I'd prefer to hide them (just like the git-repo does).

Unfortunately, unlike Git, Mercurial doesn't track directory information, so where Git Status --ignored nicely shows 'the best stuff to hide', Hg Status -i will gladly show each and every file of your node_modules folder as ignored.

The simplest option would be to unify our status cache and mark directories:

  • with at least one ignored file or directory AND
  • only ignored files or directories
    as ignored directories. We're already fetching all that info, so shouldn't take too long.

The other option dovetails with the problem that hg stat -i is sloooow. We could try to just parse .hgignore and replicate the mercurial ignore-rules. I think 90% of that will be easy, and the remaining 10% will be a hellish collection of edge-cases. Maybe porting the ignore unit-tests from mercurial could work...

Unless people feel deeply about option 2, I'll get started on option 1, since we'll be able to reuse the resulting unit-tests for option 2. I definitely think we'll need to do option 2 someday, but I'd rather add the functionality first and focus on performance later.

@victor-torres
Copy link
Owner

Mercurial should be responsible for that. But you're right. There seems to be no support for an hg status -i with ignored directories.

I also thought about parsing the .hgignore file but there may be extra files for submodules. And Mercurial supports multiple syntaxes including regexp and glob.

@TomKemperNL
Copy link
Contributor Author

TomKemperNL commented Nov 15, 2016

Just a quick update. I'm still hacking away at this on my fork (at about half an hour a week, so it's going to take a while...).

It currently works (as a nice side-effect of using the status-bitmasks at the directory level)... however it's way too slow to be practical.

(https://github.com/TomKemperNL/atom-hg/tree/ignored_dirs)

@TomKemperNL
Copy link
Contributor Author

I'm kinda drawing a blank on improving performance while shelling out to hg

The other alternative, parsing .hgignore ourselves is also looking dicey. I've been looking at the Mercurial sourcecode and there's nearly 800 lines of python code concerned with it. (having zero python experience means this is a rather slow process).

So, working on it, no clue yet how to solve it.

@gabefinch
Copy link

gabefinch commented Feb 9, 2017

I really love the plugin. Related to this bug it seems for me that atom-hg doesn't pay attention to the atom setting 'Exclude VCS Ignored Paths'. In other words .hgingnore files are hidden for me regardless of whether 'Exclude VCS Ignored Paths' is checked or not. My case is wanting to get all the benefits of the plugin, but I don't want ignored files hidden. I'm on Windows BTW.

@victor-torres
Copy link
Owner

victor-torres commented Feb 10, 2017

I really love the plugin.

Thanks, @gabefinch! I really appreciate our plugin is being helpful :)

Related to this bug it seems for me that atom-hg doesn't pay attention to the atom setting 'Exclude VCS Ignored Paths'. In other words .hgingnore files are hidden for me regardless of whether 'Exclude VCS Ignored Paths' is checked or not.

If I’m right, I think we can create another ticket for this. In your case, you want the ignored files to be shown.

My case is wanting to get all the benefits of the plugin, but I don't want ignored files hidden. I'm on Windows BTW.

Yes. We can create another ticket for that (#44).

In the case of this ticket, the problem is that when we are hiding the ignored files, if a directory only contains ignored files (or it is also ignored in .hgignore) Atom still displays it as a regular directory. This is a limitation by the Mercurial executable itself, and @TomKemperNL and I have been thinking about a way to solve this problem on the plugin side, but it seems difficult until now and almost not possible in a regular way.

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

No branches or pull requests

3 participants