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

Way to disable vcs plugins? #319

Closed
kcuzner opened this issue Oct 21, 2019 · 7 comments · Fixed by #377
Closed

Way to disable vcs plugins? #319

kcuzner opened this issue Oct 21, 2019 · 7 comments · Fixed by #377

Comments

@kcuzner
Copy link

kcuzner commented Oct 21, 2019

I have a situation where I use both git and perforce in the same folder (yeah...), but I only want signify to operate on the git repository.

I just updated my plugins today and discovered that my previous way of modifying g:signify_vcs_list so that only git was available no longer works, since g:signify_vcs_list doesn't exist anymore (#261). Is there an alternative way to disable individual vcs plugins? Perhaps using g:signify_vcs_list was the wrong way to do this in the first place?

Here's my existing vimrc:

" signify
" Turn off perforce
let g:signify_vcs_list = ['git']

This XKCD seems applicable here: https://xkcd.com/1172/

@mhinz
Copy link
Owner

mhinz commented Oct 21, 2019

If you just want to get it done for now, check out the legacy branch: https://github.com/mhinz/vim-signify#installation

I know I did quite an aggressive refactoring lately, but there were a few things that I wanted to change for a long time and.. well, it's happening now. I removed a lot of options because a) http://neugierig.org/software/blog/2018/07/options.html and b) they were introduced before Vim was capable of async execution.

g:signify_vcs_list was important in pre-async times, because it would delay the Vim start quite a lot when it checked for all installed VCS tools one after the other and blocking during the whole time.

Anyway, I see your issue. But instead of reintroducing g:signify_vcs_list, I'd like to introduce a new g:signify_skip that takes {} and replaces g:signify_skip_filetype, g:signify_skip_filename, and g:signify_skip_filename_pattern.

Maybe something like:

let g:signify_skip = {
      \ 'filename': [
      \   '~/projects/foo': ['perforce'],
      \   '~/projects/bar': ['all'],
      \ ],
      \ 'pattern': ['.*supersecret.*'],
      \ 'filetype': {'java': ['all'] },
      \ }

This gives us more flexibility than we had before, is easy to extend, and reduces the number of options. Would that work for you?

@kcuzner
Copy link
Author

kcuzner commented Oct 22, 2019

I suppose something like skipping a filename pattern would work, but I'd end up turning off perforce altogether for basically C:\ (yeah it's on windows...). I never use perforce by itself really. I suppose I could also "turn off" perforce by trying to mangle the path or other things so that it can't find the tool, but that is an incredible hack.

I understand that adding options requires real justification and easily leads to software bloat. I use tools on a daily basis plagued by options accumulated over decades and now come with literal 10,000 page manuals. However, for something like this where the "default" installation comes with support for multiple VCS, many of which most people won't use concurrently, it seems like having a way to simply limit the supported VCS borders on basic functionality. All that would be needed would be to add another entry in the signify_skip dictionary to skip entire vcs globally. You'd probably already skip patterns and filetypes with signify_skip, so skipping vcs as well seems only natural.

mhinz added a commit that referenced this issue Oct 22, 2019
Allow only certain VCS or deny all but the specified ones. Mutual exclusive.

This can be used to replace the old g:signify_vcs_list.

Examples:

  let g:signify_skip = {'vcs': { 'allow': ['git'] }}
  let g:signify_skip = {'vcs': { 'deny': ['perforce'] }}

References #319
@mhinz
Copy link
Owner

mhinz commented Oct 22, 2019

Okay, so the commit above below should work for your use case.

It's not documented yet on purpose, in case we want to change things in the next days.

mhinz added a commit that referenced this issue Oct 22, 2019
Allow only certain VCS or deny all but the specified ones. Mutual exclusive.

This can be used to replace the old g:signify_vcs_list.

Examples:

  let g:signify_skip = {'vcs': { 'allow': ['git'] }}
  let g:signify_skip = {'vcs': { 'deny': ['perforce'] }}

References #319
@kcuzner
Copy link
Author

kcuzner commented Oct 23, 2019

I tested and it works for me!

" signify
" Turn off perforce
" Undocumented new feature: https://github.com/mhinz/vim-signify/issues/319
let g:signify_skip = {'vcs': { 'deny': ['perforce'] }}

@calid
Copy link

calid commented Oct 6, 2020

is this still considered undocumented/subject to change?

Edit: doesn't appear to work for me, not sure if it was rolled back

chunkhang added a commit to chunkhang/dotfiles that referenced this issue Nov 4, 2020
@KapJI
Copy link
Contributor

KapJI commented Jan 23, 2021

It actually works fine but missing documentation.

@polyzen
Copy link
Contributor

polyzen commented May 20, 2021

It actually works fine but missing documentation.

#377

@jamessan jamessan linked a pull request Dec 27, 2021 that will close this issue
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 a pull request may close this issue.

5 participants