From de02a4ba84b3daf70c9b6f22aabf03a482b7bc80 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 17 Aug 2021 22:36:22 -0400 Subject: [PATCH] Change deprecated Git wrappers to error stubs --- plugin/fugitive.vim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 98d607c..759c5ad 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -479,10 +479,13 @@ if exists(':Gstatus') != 2 && get(g:, 'fugitive_legacy_commands', 1) endif for s:cmd in ['Commit', 'Revert', 'Merge', 'Rebase', 'Pull', 'Push', 'Fetch', 'Blame'] - if exists(':G' . tolower(s:cmd)) != 2 && get(g:, 'fugitive_legacy_commands', 1) + if exists(':G' . tolower(s:cmd)) != 2 && get(g:, 'fugitive_legacy_commands', 0) exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#' . s:cmd . 'Complete G' . tolower(s:cmd) \ 'echohl WarningMSG|echomsg ":G' . tolower(s:cmd) . ' is deprecated in favor of :Git ' . tolower(s:cmd) . '"|echohl NONE|' \ 'exe fugitive#Command(, , +"", 0, "", "' . tolower(s:cmd) . ' " . )' + elseif exists(':G' . tolower(s:cmd)) != 2 && !exists('g:fugitive_legacy_commands') + exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#' . s:cmd . 'Complete G' . tolower(s:cmd) + \ 'echoerr ":G' . tolower(s:cmd) . ' has been removed in favor of :Git ' . tolower(s:cmd) . '"' endif endfor unlet s:cmd @@ -494,9 +497,12 @@ exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugiti exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugitive#GrepComplete Gcgrep exe fugitive#GrepCommand(, , +"", 0, "", )' exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugitive#GrepComplete Glgrep exe fugitive#GrepCommand(0, > 0 ? : 0, +"", 0, "", )' -if exists(':Glog') != 2 && get(g:, 'fugitive_legacy_commands', 1) +if exists(':Glog') != 2 && get(g:, 'fugitive_legacy_commands', 0) exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Glog :exe fugitive#LogCommand(,,+"",0,"",, "")' \ '|echohl WarningMSG|echomsg ":Glog is deprecated in favor of :Gclog"|echohl NONE' +elseif exists(':Glog') != 2 && !exists('g:fugitive_legacy_commands') + exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Glog' + \ ' echoerr ":Glog has been removed in favor of :Gclog"' endif exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Gclog :exe fugitive#LogCommand(,,+"",0,"",, "c")' exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete GcLog :exe fugitive#LogCommand(,,+"",0,"",, "c")'