Create Changelog when performing BundleInstall!
Keeps track of the current commit with a vundle_update tag before perfoming an update and adds all commits pulled in the update to a Changelog accessible via pressing 'u' after BundleInstall! completes.
This commit is contained in:
@@ -33,6 +33,33 @@ func! s:view_log()
|
||||
wincmd P | wincmd H
|
||||
endf
|
||||
|
||||
func! s:create_changelog() abort
|
||||
for bundle in g:updated_bundles
|
||||
let updates = system('cd '.shellescape(bundle.path()).
|
||||
\ ' && git log --pretty=format:"%s %an, %ar" --graph'.
|
||||
\ ' vundle_update..HEAD')
|
||||
call add(g:vundle_changelog, '')
|
||||
call add(g:vundle_changelog, 'Updated Bundle: '.bundle.name)
|
||||
for update in split(updates, '\n')
|
||||
let update = substitute(update, '\s\+$', '', '')
|
||||
call add(g:vundle_changelog, ' '.update)
|
||||
endfor
|
||||
endfor
|
||||
endf
|
||||
|
||||
func! s:view_changelog()
|
||||
call s:create_changelog()
|
||||
|
||||
if !exists('g:vundle_changelog_file')
|
||||
let g:vundle_changelog_file = tempname()
|
||||
endif
|
||||
|
||||
call writefile(g:vundle_changelog, g:vundle_changelog_file)
|
||||
silent pedit `=g:vundle_changelog_file`
|
||||
|
||||
wincmd P | wincmd H
|
||||
endf
|
||||
|
||||
func! vundle#scripts#bundle_names(names)
|
||||
return map(copy(a:names), ' printf("Bundle ' ."'%s'".'", v:val) ')
|
||||
endf
|
||||
@@ -80,6 +107,7 @@ func! vundle#scripts#view(title, headers, results)
|
||||
|
||||
com! -buffer -nargs=0 VundleLog call s:view_log()
|
||||
|
||||
com! -buffer -nargs=0 VundleChangelog call s:view_changelog()
|
||||
|
||||
nnoremap <buffer> q :silent bd!<CR>
|
||||
nnoremap <buffer> D :exec 'Delete'.getline('.')<CR>
|
||||
@@ -91,6 +119,7 @@ func! vundle#scripts#view(title, headers, results)
|
||||
nnoremap <buffer> I :exec 'InstallAndRequire'.substitute(getline('.'), '^Bundle ', 'Bundle! ', '')<CR>
|
||||
|
||||
nnoremap <buffer> l :VundleLog<CR>
|
||||
nnoremap <buffer> u :VundleChangelog<CR>
|
||||
nnoremap <buffer> h :h vundle<CR>
|
||||
nnoremap <buffer> ? :norm h<CR>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user