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

Add setting to show only version controlled files #1343

Closed
wants to merge 1 commit into from
Closed

Add setting to show only version controlled files #1343

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 15, 2018

Issue #1074.

Adds a setting "vcs_filter" which can be set to "untracked" in order to hide untracked files. Feature is incomplete.

ISSUE TYPE

  • Improvement/feature implementation

RUNTIME ENVIRONMENT

  • Operating system and version: Ubuntu 18.04
  • Terminal emulator and version: urxvt v9.22
  • Python version: 2.7.15
  • Ranger version/commit: 1.9.2
  • Locale: en_US.UTF-8

CHECKLIST

  • The CONTRIBUTING document has been read [REQUIRED]
  • All changes follow the code style [REQUIRED]
  • All new and existing tests pass [REQUIRED]
  • Changes require config files to be updated
    • Config files have been updated
  • Changes require documentation to be updated
    • Documentation has been updated
  • Changes require tests to be updated
    • Tests have been updated

DESCRIPTION

Setting "vcs_filter" to "untracked", and then refiltering the directory with reload_cwd or eval fm.thisdir.refilter(), will hide untracked files in a version-controlled repository. I'm stuck on how to get past this limitation. If someone is interested in this feature and willing to help, we can try to complete it. You can use "set vcs_filter" (and reload) to unset the filter. And since it was no extra work, you can set "vcs_filter" to "sync" to hide all unchanged, tracked files, and "changed" to hide all changed, tracked files.

MOTIVATION AND CONTEXT

Issue #1074 requests a setting to toggle visibility of untracked files in repositories.

TESTING

Passed make test in Python 2.

@cibinmathew
Copy link

cibinmathew commented Nov 13, 2018

Is this still under development as I see the account associated with ghost account now

@toonn
Copy link
Member

toonn commented Nov 13, 2018

We'll shepherd the change if we agree it's necessary/an improvement. Not a priority tbh.

@zanona
Copy link

zanona commented Dec 17, 2018

Just my 2 cents, if that's OK.

I often visit my project GitHub page only to preview my repository files which helps to provide a better perception of how files are structured and laid-out rather than listing those under my local repository, which is usually, polluted of dependencies and built files.

Being able to display only staged files would really help to eliminate the need of that and improve the notion of ones overall project structure. I believe it could be a great addition.

@toonn
Copy link
Member

toonn commented Dec 17, 2018

We welcome the comments, means there's actual interest in the feature. However, to be quite honest, we currently don't have much time to add features. The quickest way for this to get accepted is for someone to pick up the work. Feel free to join #ranger@freenode if you want some guidance on contributing to ranger.

@vifon
Copy link
Member

vifon commented Dec 18, 2018

It could be implemented with our filter stack. Run git ls-files, turn it into a set and then check if the file is in there. (with caching of this set for performance)

I can do this later, sounds useful.

@vifon
Copy link
Member

vifon commented Dec 18, 2018

Ah, I only now noticed it's a PR, not an issue. Well then, even better. Should be pretty easy to turn it into a filter for filter stack. I'd strongly suggest it.

@cibinmathew
Copy link

Can we merge this or I can re raise as the account has already been into ghost and work on issues if any.

@toonn
Copy link
Member

toonn commented Feb 10, 2019

@vifon, I'm deferring to you since filter_stack's in your RAM.

@vifon
Copy link
Member

vifon commented Feb 13, 2019

Can we merge this or I can re raise as the account has already been into ghost and work on issues if any.

I'd rather see it implemented as a filter_stack filter, so I'm going to close this one. Feel free to open a new PR based on this, @cibinmathew.

@vifon vifon closed this Feb 13, 2019
@cibinmathew
Copy link

With an implementation in filter_stack, does it make sense to have something like this for
filter_stack add type vcs
or
filter_stack add vcs_aware tracked

@toonn
Copy link
Member

toonn commented Jul 13, 2019

I'm leaning towards the second option. Maybe drop the "_aware".

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

Successfully merging this pull request may close these issues.

4 participants