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:
Matt Furden
2012-04-04 19:26:13 -07:00
parent dd8356aea7
commit 09560847ca
5 changed files with 54 additions and 7 deletions

View File

@@ -204,6 +204,7 @@ func! s:sync(bang, bundle) abort
let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives
let cmd = '"'.cmd.'"' " enclose in quotes
endif
call s:add_update_tag(a:bundle)
else
let cmd = 'git clone '.a:bundle.uri.' '.shellescape(a:bundle.path())
endif
@@ -222,6 +223,7 @@ func! s:sync(bang, bundle) abort
return 'todate'
end
call s:add_to_updated_bundle_list(a:bundle)
return 'updated'
endf
@@ -229,6 +231,19 @@ func! s:system(cmd) abort
return system(a:cmd)
endf
func! s:add_update_tag(bundle) abort
call s:system('cd '.shellescape(a:bundle.path()).
\ ' && git tag -a vundle_update -m "Last Vundle Update" -f')
endfunc
func! s:add_to_updated_bundle_list(bundle) abort
let current_commit = s:system('cd '.shellescape(a:bundle.path()).' && git rev-list HEAD')
let initial_commit = s:system('cd '.shellescape(a:bundle.path()).' && git rev-list vundle_update')
if (0 == v:shell_error) && (initial_commit != current_commit)
call add(g:updated_bundles, a:bundle)
endif
endfunc
func! s:log(str) abort
let fmt = '%y%m%d %H:%M:%S'
call add(g:vundle_log, '['.strftime(fmt).'] '.a:str)