From 649cb2dc05316a4e933ddf467acfa5ac8c1e020e Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 12 Apr 2021 12:06:18 -0400 Subject: [PATCH] Add deprecation warnings to :Glog and :Gstatus --- autoload/fugitive.vim | 3 --- plugin/fugitive.vim | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index a22df8a..cb6047c 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -4835,9 +4835,6 @@ function! fugitive#LogCommand(line1, count, range, bang, mods, args, type) abort \ args + extra_args + paths + extra_paths) let state.target = path let title = titlepre . (listnr < 0 ? 'Gclog ' : 'Gllog ') . s:fnameescape(args + paths) - if empty(paths + extra_paths) && empty(a:type) && a:count < 0 && len(s:Relative('/')) - let after = '|echohl WarningMsg|echo ' . string('Use :0Glog or :0Gclog for old behavior of targeting current file') . '|echohl NONE' . after - endif return s:QuickfixStream(listnr, 'log', title, s:UserCommandList(dir) + cmd, !a:bang, a:mods, s:function('s:LogParse'), state, dir) . after endfunction diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 0fa57ae..58d6c22 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -425,6 +425,7 @@ command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#Complete Git exe if exists(':Gstatus') != 2 && get(g:, 'fugitive_legacy_commands', 1) exe 'command! -bang -bar -range=-1' s:addr_other 'Gstatus exe fugitive#Command(, , +"", 0, "", )' + \ '|echohl WarningMSG|echo ":Gstatus is deprecated in favor of :Git (with no arguments)"|echohl NONE' endif for s:cmd in ['Commit', 'Revert', 'Merge', 'Rebase', 'Pull', 'Push', 'Fetch', 'Blame'] @@ -445,6 +446,7 @@ exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugiti if exists(':Glog') != 2 && get(g:, 'fugitive_legacy_commands', 1) exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Glog :exe fugitive#LogCommand(,,+"",0,"",, "")' + \ '|echohl WarningMSG|echo ":Glog is deprecated in favor of :Gclog"|echohl NONE' 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")'