Provide s/u mappings on commits

I need to figure out the big picture push story before I can document
the push maps.
This commit is contained in:
Tim Pope 2019-08-04 01:15:35 -04:00
parent c4d4986f1e
commit 35d7590354
2 changed files with 25 additions and 5 deletions

View File

@ -3047,7 +3047,7 @@ function! s:DoToggleHeadHeader(value) abort
call search('\C^index$', 'wc')
endfunction
function! s:DoToggleUnpushedHeading(heading) abort
function! s:DoStageUnpushedHeading(heading) abort
let remote = matchstr(a:heading, 'to \zs[^/]\+\ze/')
if empty(remote)
let remote = '.'
@ -3056,7 +3056,11 @@ function! s:DoToggleUnpushedHeading(heading) abort
call feedkeys(':Gpush ' . remote . ' ' . 'HEAD:' . branch)
endfunction
function! s:DoToggleUnpushed(record) abort
function! s:DoToggleUnpushedHeading(heading) abort
return s:DoStageUnpushedHeading(a:heading)
endfunction
function! s:DoStageUnpushed(record) abort
let remote = matchstr(a:record.heading, 'to \zs[^/]\+\ze/')
if empty(remote)
let remote = '.'
@ -3065,12 +3069,28 @@ function! s:DoToggleUnpushed(record) abort
call feedkeys(':Gpush ' . remote . ' ' . a:record.commit . ':' . branch)
endfunction
function! s:DoToggleUnpulledHeading(heading) abort
function! s:DoToggleUnpushed(record) abort
return s:DoStageUnpushed(a:record)
endfunction
function! s:DoUnstageUnpulledHeading(heading) abort
call feedkeys(':Grebase')
endfunction
function! s:DoToggleUnpulledHeading(heading) abort
call s:DoUnstageUnpulledHeading(a:heading)
endfunction
function! s:DoUnstageUnpulled(record) abort
call feedkeys(':Grebase ' . a:record.commit . '^')
endfunction
function! s:DoToggleUnpulled(record) abort
call feedkeys(':Grebase ' . a:record.commit)
call s:DoUnstageUnpulled(a:record)
endfunction
function! s:DoUnstageUnpushed(record) abort
call s:DoUnstageUnpulled(a:record)
endfunction
function! s:DoToggleStagedHeading(...) abort

View File

@ -483,7 +483,7 @@ cz? Show this help.
Rebase mappings ~
ri Perform an interactive rebase. Uses ancestor of
commit under cursor as upstream if available.
u commit under cursor as upstream if available.
rf Perform an autosquash rebase without editing the todo
list. Uses ancestor of commit under cursor as