Begin phasing out :Git --paginate special case

This was a mistake.  I took --paginate to be the opposite of --no-pager,
but it forces $PAGER over $GIT_PAGER and pager configuration.  This
defeats the purpose of using it as way to trick :Git into running a
regular command with :terminal.

References https://github.com/tpope/vim-fugitive/issues/1415
This commit is contained in:
Tim Pope
2020-01-14 20:42:05 -05:00
parent 6a638f2392
commit 305337a9c1
2 changed files with 6 additions and 3 deletions

View File

@@ -92,9 +92,8 @@ request the password via a GUI. Fugitive will configure this for you
automatically if you have `ssh-askpass` or `git-gui` installed; otherwise it's
your responsibility to set this up.
As an absolute last resort, you can invoke `:Git --paginate push`. Fugitive
recognizes the pagination request and fires up a `:terminal`, which allows for
interactive password entry.
If you absolutely must type in your password by hand, sidestep Fugitive and
use `:terminal git push`.
[credentials caching]: https://help.github.com/en/articles/caching-your-github-password-in-git

View File

@@ -2192,6 +2192,10 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
\ (args[0] ==# 'help' || get(args, 1, '') ==# '--help') && !s:HasOpt(args, '--web')
return s:OpenExec((a:line2 > 0 ? a:line2 : '') . (a:line2 ? 'split' : 'edit'), a:mods, args, dir) . after
endif
if index(['--paginate', '-p'], args[0]) >= 0
let paginate_warning = 'fugitive: --paginate support is deprecated. Use :terminal directly'
let after = '|echohl WarningMsg|echo ' . string(paginate_warning) . '|echohl NONE' . after
endif
if s:HasOpt(args, ['add', 'checkout', 'commit', 'stage', 'stash', 'reset'], '-p', '--patch') ||
\ s:HasOpt(args, ['add', 'clean', 'stage'], '-i', '--interactive') ||
\ index(['--paginate', '-p'], args[0]) >= 0