Skip to content

Commit d4bcc75

Browse files
committed
Remove dispatch.vim backed fetch and push
1 parent 0cc2190 commit d4bcc75

File tree

2 files changed

+13
-59
lines changed

2 files changed

+13
-59
lines changed

README.markdown

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,18 @@ Install using your favorite package manager, or use Vim's built-in package suppo
9292

9393
## FAQ
9494

95-
> Why can't I enter my password when I `:Git push`?
96-
97-
It is highly recommended to use SSH keys or [credentials caching][] to avoid
98-
entering your password on every upstream interaction. If this isn't an
99-
option, the official solution is to use the `core.askPass` Git option to
100-
request the password via a GUI. Fugitive will configure this for you
101-
automatically if you have `ssh-askpass` or `git-gui` installed; otherwise it's
102-
your responsibility to set this up.
103-
104-
If you absolutely must type in your password by hand, sidestep Fugitive and
105-
use `:terminal git push`.
95+
> What happened to the dispatch.vim backed asynchronous `:Gpush` and
96+
> `:Gfetch`?
97+
98+
This behavior was divisive, confusing, and complicated inputting passwords, so
99+
it was removed. Use `:Dispatch git push` for effectively the same behavior,
100+
or provide your own asynchronous `:Gpush` and `:Gfetch` by adding the
101+
following to your vimrc:
102+
103+
command! -bang -bar -nargs=* Gpush execute 'Dispatch<bang> -dir=' .
104+
\ fnameescape(FugitiveGitDir()) 'git push' <q-args>
105+
command! -bang -bar -nargs=* Gfetch execute 'Dispatch<bang> -dir=' .
106+
\ fnameescape(FugitiveGitDir()) 'git fetch' <q-args>
106107

107108
[credentials caching]: https://help.github.com/en/articles/caching-your-github-password-in-git
108109

autoload/fugitive.vim

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -664,14 +664,6 @@ function! s:QuickfixStream(nr, event, title, cmd, first, callback, ...) abort
664664
endif
665665
endfunction
666666

667-
let s:common_efm = ''
668-
\ . '%+Egit:%.%#,'
669-
\ . '%+Eusage:%.%#,'
670-
\ . '%+Eerror:%.%#,'
671-
\ . '%+Efatal:%.%#,'
672-
\ . '%-G%.%#%\e[K%.%#,'
673-
\ . '%-G%.%#%\r%.%\+'
674-
675667
function! fugitive#Cwindow() abort
676668
if &buftype == 'quickfix'
677669
cwindow
@@ -1967,7 +1959,7 @@ function! fugitive#BufReadStatus() abort
19671959
if &bufhidden ==# ''
19681960
setlocal bufhidden=delete
19691961
endif
1970-
let b:dispatch = ':Git fetch --all'
1962+
let b:dispatch = '-dir=' . fnameescape(len(s:Tree()) ? s:Tree() : s:Dir()) . ' ' . g:fugitive_git_executable . ' fetch --all'
19711963
call fugitive#MapJumps()
19721964
call s:Map('n', '-', ":<C-U>execute <SID>Do('Toggle',0)<CR>", '<silent>')
19731965
call s:Map('x', '-', ":<C-U>execute <SID>Do('Toggle',1)<CR>", '<silent>')
@@ -4780,45 +4772,6 @@ function! fugitive#FetchComplete(A, L, P, ...) abort
47804772
return s:CompleteSub('fetch', a:A, a:L, a:P, function('s:CompleteRemote'), a:000)
47814773
endfunction
47824774

4783-
function! s:Dispatch(bang, options) abort
4784-
let dir = a:options.dir
4785-
exe s:DirCheck(dir)
4786-
let [mp, efm, cc] = [&l:mp, &l:efm, get(b:, 'current_compiler', '')]
4787-
try
4788-
let b:current_compiler = 'git'
4789-
let &l:errorformat = s:common_efm .
4790-
\ ',%\&git_dir=' . escape(substitute(dir, '%', '%%', 'g'), '\,')
4791-
let &l:makeprg = s:UserCommand({'git': a:options.git, 'dir': dir}, s:AskPassArgs(dir) + a:options.flags + [a:options.command] + a:options.args)
4792-
if exists(':Make') == 2
4793-
Make
4794-
return ''
4795-
else
4796-
if !has('patch-8.1.0334') && has('terminal') && &autowrite
4797-
let autowrite_was_set = 1
4798-
set noautowrite
4799-
silent! wall
4800-
endif
4801-
silent noautocmd make!
4802-
redraw!
4803-
return 'call fugitive#Cwindow()|silent ' . s:DoAutocmd('ShellCmdPost')
4804-
endif
4805-
finally
4806-
let [&l:mp, &l:efm, b:current_compiler] = [mp, efm, cc]
4807-
if empty(cc) | unlet! b:current_compiler | endif
4808-
if exists('autowrite_was_set')
4809-
set autowrite
4810-
endif
4811-
endtry
4812-
endfunction
4813-
4814-
function! s:PushSubcommand(line1, line2, range, bang, mods, options) abort
4815-
return s:Dispatch(a:bang ? '!' : '', a:options)
4816-
endfunction
4817-
4818-
function! s:FetchSubcommand(line1, line2, range, bang, mods, options) abort
4819-
return s:Dispatch(a:bang ? '!' : '', a:options)
4820-
endfunction
4821-
48224775
" Section: :Gdiff
48234776

48244777
augroup fugitive_diff

0 commit comments

Comments
 (0)