mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 14:23:51 -05:00
Provide :Grebase (no --interactive)
This commit is contained in:
@@ -87,6 +87,10 @@ that are part of Git repositories).
|
|||||||
*fugitive-:Gpull*
|
*fugitive-:Gpull*
|
||||||
:Gpull [args] Like |:Gmerge|, but for git-pull.
|
:Gpull [args] Like |:Gmerge|, but for git-pull.
|
||||||
|
|
||||||
|
*fugitive-:Grebase*
|
||||||
|
:Grebase [args] Like |:Gmerge|, but for git-rebase. Interactive
|
||||||
|
rebase not suppported.
|
||||||
|
|
||||||
*fugitive-:Gpush*
|
*fugitive-:Gpush*
|
||||||
:Gpush [args] Invoke git-push, load the results into the |quickfix|
|
:Gpush [args] Invoke git-push, load the results into the |quickfix|
|
||||||
list, and invoke |:cwindow| to reveal any errors.
|
list, and invoke |:cwindow| to reveal any errors.
|
||||||
|
|||||||
@@ -1213,6 +1213,8 @@ endfunction
|
|||||||
|
|
||||||
call s:command("-nargs=? -bang -complete=custom,s:RevisionComplete Gmerge " .
|
call s:command("-nargs=? -bang -complete=custom,s:RevisionComplete Gmerge " .
|
||||||
\ "execute s:Merge('merge', <bang>0, <q-args>)")
|
\ "execute s:Merge('merge', <bang>0, <q-args>)")
|
||||||
|
call s:command("-nargs=? -bang -complete=custom,s:RevisionComplete Grebase " .
|
||||||
|
\ "execute s:Merge('rebase', <bang>0, <q-args>)")
|
||||||
call s:command("-nargs=? -bang -complete=custom,s:RemoteComplete Gpull " .
|
call s:command("-nargs=? -bang -complete=custom,s:RemoteComplete Gpull " .
|
||||||
\ "execute s:Merge('pull --progress', <bang>0, <q-args>)")
|
\ "execute s:Merge('pull --progress', <bang>0, <q-args>)")
|
||||||
|
|
||||||
@@ -1253,6 +1255,9 @@ let s:common_efm = ''
|
|||||||
\ . '%-G%.%#%\r%.%\+'
|
\ . '%-G%.%#%\r%.%\+'
|
||||||
|
|
||||||
function! s:Merge(cmd, bang, args) abort
|
function! s:Merge(cmd, bang, args) abort
|
||||||
|
if a:cmd =~# '^rebase' && ' '.a:args =~# ' -i\| --interactive\| --edit-todo'
|
||||||
|
return 'echoerr "git rebase --interactive not supported"'
|
||||||
|
endif
|
||||||
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd'
|
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd'
|
||||||
let cwd = getcwd()
|
let cwd = getcwd()
|
||||||
let [mp, efm] = [&l:mp, &l:efm]
|
let [mp, efm] = [&l:mp, &l:efm]
|
||||||
@@ -1284,7 +1289,7 @@ function! s:Merge(cmd, bang, args) abort
|
|||||||
let &l:makeprg = g:fugitive_git_executable.' diff-files --name-status --diff-filter=U'
|
let &l:makeprg = g:fugitive_git_executable.' diff-files --name-status --diff-filter=U'
|
||||||
else
|
else
|
||||||
let &l:makeprg = s:sub(s:git_command() . ' ' . a:cmd .
|
let &l:makeprg = s:sub(s:git_command() . ' ' . a:cmd .
|
||||||
\ (a:args =~# ' \%(--no-edit\|--abort\|-m\)\>' ? '' : ' --edit') .
|
\ (a:args =~# ' \%(--no-edit\|--abort\|-m\)\>' || a:cmd =~# '^rebase' ? '' : ' --edit') .
|
||||||
\ ' ' . a:args, ' *$', '')
|
\ ' ' . a:args, ' *$', '')
|
||||||
endif
|
endif
|
||||||
if !empty($GIT_EDITOR) || has('win32')
|
if !empty($GIT_EDITOR) || has('win32')
|
||||||
|
|||||||
Reference in New Issue
Block a user