Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
72da8f8
Trim trailing whitespace at logging time
nfischer Nov 18, 2015
4ec18dc
Adding syntax highlighting for normal log files
nfischer Nov 18, 2015
2b19476
Added variables for git, curl & wget executables, making it easier to…
cameris Jan 2, 2016
651a47f
Corrected endif typo
cameris Jan 18, 2016
87eb7c2
Harden system calls to git
layus Feb 26, 2016
4629700
Fix syntax (and other) issues
layus Feb 26, 2016
5a59dd7
Merge branch 'WhiteSpace' of https://github.com/nfischer/Vundle.vim i…
ryanoasis Apr 10, 2016
58742e7
Merge branch 'LogHighlighting' of https://github.com/nfischer/Vundle.…
ryanoasis Apr 10, 2016
ff02eb1
Merge branch 'master' of https://github.com/cameris/Vundle.vim into c…
ryanoasis Apr 10, 2016
b4328e2
Merge pull request #671 from nfischer/WhiteSpace
ryanoasis Apr 22, 2016
a6575b6
Merge pull request #683 from nfischer/LogHighlighting
ryanoasis Apr 22, 2016
1d1c2b0
Merge pull request #684 from cameris/master
ryanoasis Apr 22, 2016
2af7685
Merge pull request #699 from layus/master
ryanoasis Apr 22, 2016
1f2c331
fixup harden git
layus Apr 23, 2016
d092561
Merge pull request #719 from layus/fixup-harden-git
ryanoasis Apr 24, 2016
4b12023
bump: Merge `0.10.3` from `VundleVim/Vundle.vim@d092561`
5HT2 Sep 3, 2024
633f352
Trim trailing whitespace at logging time
nfischer Nov 18, 2015
68b17c4
Adding syntax highlighting for normal log files
nfischer Nov 18, 2015
44bd030
Added variables for git, curl & wget executables, making it easier to…
cameris Jan 2, 2016
3823167
Corrected endif typo
cameris Jan 18, 2016
0cdf476
Merge branch 'VundleVim-0.10.3' into VundleVim-0.10.3-p
5HT2 Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions autoload/vundle.vim
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,14 @@ let vundle#lazy_load = 0
let vundle#log = []
let vundle#updated_bundles = []

if !exists('g:vundle#git_executable')
let vundle#git_executable = 'git'
endif
if !exists('g:vundle#curl_executable')
let vundle#curl_executable = 'curl'
endif
if !exists('g:vundle#wget_executable')
let vundle#wget_executable = 'wget'
endif

" vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl:
68 changes: 45 additions & 23 deletions autoload/vundle/installer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,7 @@ endf
" return -- the URL for the origin remote (string)
" ---------------------------------------------------------------------------
func! s:get_current_origin_url(bundle) abort
let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git config --get remote.origin.url'
let cmd = vundle#installer#shellesc_cd(cmd)
let cmd = s:make_git_command(a:bundle, ['config', '--get', 'remote.origin.url'])
let out = s:strip(s:system(cmd))
return out
endf
Expand All @@ -357,12 +356,37 @@ endf
" return -- A 15 character log sha for the current HEAD
" ---------------------------------------------------------------------------
func! s:get_current_sha(bundle)
let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git rev-parse HEAD'
let cmd = vundle#installer#shellesc_cd(cmd)
let cmd = s:make_git_command(a:bundle, ['rev-parse', 'HEAD'])
let out = s:system(cmd)[0:15]
return out
endf

" ---------------------------------------------------------------------------
" Build a safe (escaped) git command
"
" bundle -- A bundle object to get the path to the git dir
" args -- A list of arguments to the git executable
" return -- A string containing the escaped shell command
" ---------------------------------------------------------------------------
func! s:make_git_command(bundle, args) abort
let workdir = a:bundle.path()
let gitdir = workdir.'/.git/'

let git = [g:vundle#git_executable, '--git-dir='.gitdir, '--work-tree='.workdir]

return join(map(git + a:args, 'vundle#installer#shellesc(v:val)'))
endf

" ---------------------------------------------------------------------------
" Build a safe (escaped) command from list of git args
"
" bundle -- A bundle object to get the path to the git dir
" argss -- A list of lists of arguments to successive git calls
" return -- A string containing the escaped shell command
" ---------------------------------------------------------------------------
func! s:make_git_commands(bundle, argss) abort
return join(map(a:argss, 's:make_git_command(a:bundle, v:val)'), ' && ')
endf

" ---------------------------------------------------------------------------
" Create the appropriate sync command to run according to the current state of
Expand All @@ -388,15 +412,13 @@ func! s:make_sync_command(bang, bundle) abort
call s:log('> Plugin ' . a:bundle.name . ' new URI: ' . a:bundle.uri)
" Directory names match but the origin remotes are not the same
let cmd_parts = [
\ 'cd '.vundle#installer#shellesc(a:bundle.path()) ,
\ 'git remote set-url origin ' . vundle#installer#shellesc(a:bundle.uri),
\ 'git fetch',
\ 'git reset --hard origin/HEAD',
\ 'git submodule sync --recursive',
\ 'git submodule update --init --recursive',
\ ]
let cmd = join(cmd_parts, ' && ')
let cmd = vundle#installer#shellesc_cd(cmd)
\ [ 'remote', 'set-url', 'origin', a:bundle.uri ],
\ [ 'fetch' ],
\ [ 'reset', '--hard', 'origin/HEAD' ],
\ [ 'submodule', 'sync', '--recursive' ]
\ [ 'submodule', 'update', '--init', '--recursive' ]
\]
let cmd = s:make_git_commands(a:bundle, cmd_parts)
let initial_sha = ''
return [cmd, initial_sha]
endif
Expand All @@ -407,17 +429,14 @@ func! s:make_sync_command(bang, bundle) abort
endif

let cmd_parts = [
\ 'cd '.vundle#installer#shellesc(a:bundle.path()),
\ 'git pull',
\ 'git submodule sync --recursive',
\ 'git submodule update --init --recursive',
\ ]
let cmd = join(cmd_parts, ' && ')
let cmd = vundle#installer#shellesc_cd(cmd)

\ [ 'pull'],
\ [ 'submodule', 'sync', '--init', '--recursive']
\ [ 'submodule', 'update', '--init', '--recursive']
\]
let cmd = s:make_git_commands(a:bundle, cmd_parts)
let initial_sha = s:get_current_sha(a:bundle)
else
let cmd = 'git clone --depth 1 --recursive --shallow-submodules '.vundle#installer#shellesc(a:bundle.uri).' '.vundle#installer#shellesc(a:bundle.path())
let cmd = s:make_git_command(a:bundle, ['clone', '--depth', '1', '--recursive', '--shallow-submodules', a:bundle.uri, a:bundle.path()])
let initial_sha = ''
endif
return [cmd, initial_sha]
Expand Down Expand Up @@ -588,8 +607,11 @@ func! s:log(str, ...) abort
let fmt = '%Y-%m-%d %H:%M:%S'
let lines = split(a:str, '\n', 1)
let time = strftime(fmt)
let entry_prefix = '['. time .'] '. prefix
for line in lines
call add(g:vundle#log, '['. time .'] '. prefix . line)
" Trim trailing whitespace
let entry = substitute(entry_prefix . line, '\m\s\+$', '', '')
call add(g:vundle#log, entry)
endfor
return a:str
endf
Expand Down
18 changes: 8 additions & 10 deletions autoload/vundle/scripts.vim
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func! s:view_log()
setl buftype=nofile
setl noswapfile
setl ro noma
setfiletype vundlelog

wincmd P | wincmd H
endf
Expand All @@ -83,11 +84,8 @@ func! s:create_changelog() abort
let updated_sha = bundle_data[1]
let bundle = bundle_data[2]

let cmd = 'cd '.vundle#installer#shellesc(bundle.path()).
\ ' && git log --pretty=format:"%s %an, %ar" --graph '.
\ initial_sha.'..'.updated_sha

let cmd = vundle#installer#shellesc_cd(cmd)
let cmd = s:make_git_command(bundle, ['log', '--pretty=format:"%s %an, %ar"',
\ '--graph', initial_sha.'..'.updated_sha ])

let updates = system(cmd)

Expand Down Expand Up @@ -124,7 +122,7 @@ func! s:view_changelog()
setl buftype=nofile
setl noswapfile
setl ro noma
setfiletype vundlelog
setfiletype vundlechangelog

wincmd P | wincmd H
endf
Expand Down Expand Up @@ -235,11 +233,11 @@ func! s:fetch_scripts(to)
endif

let l:vim_scripts_json = 'http://vim-scripts.org/api/scripts.json'
if executable("curl")
let cmd = 'curl --fail -s -o '.vundle#installer#shellesc(a:to).' '.l:vim_scripts_json
elseif executable("wget")
if executable(g:vundle#curl_executable)
let cmd = g:vundle#curl_executable.' --fail -s -o '.vundle#installer#shellesc(a:to).' '.l:vim_scripts_json
elseif executable(g:vundle#wget_executable)
let temp = vundle#installer#shellesc(tempname())
let cmd = 'wget -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.vundle#installer#shellesc(a:to)
let cmd = g:vundle#wget_executable.' -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.vundle#installer#shellesc(a:to)
if (has('win32') || has('win64'))
let cmd = substitute(cmd, 'mv -f ', 'move /Y ', '') " change force flag
let cmd = vundle#installer#shellesc(cmd)
Expand Down
34 changes: 34 additions & 0 deletions d8057395f7b68406fac0255c023b68d6a9a1e5f5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From d8057395f7b68406fac0255c023b68d6a9a1e5f5 Mon Sep 17 00:00:00 2001
From: Chip Hogg <charles.r.hogg@gmail.com>
Date: Sun, 6 Nov 2016 12:55:47 -0500
Subject: [PATCH] Recognize underscores as commit tree characters

Currently, any line in a commit tree representation with an underscore
will not be highlighted correctly. The solution is to add the
underscore to the list of commit tree characters.

Fixes #766.
---
syntax/vundlechangelog.vim | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/syntax/vundlechangelog.vim b/syntax/vundlechangelog.vim
index 64e81e32..fc68ea60 100644
--- a/syntax/vundlechangelog.vim
+++ b/syntax/vundlechangelog.vim
@@ -19,7 +19,7 @@ highlight link VundleCompareUrl Underlined
" The main commit line.
" Note that this regex is intimately related to the one for VundleCommitTree,
" and the two should be changed in sync.
-syntax match VundleCommitLine '\v(^ [|*]( *[\\|/\*])* )@<=[^*|].*$'
+syntax match VundleCommitLine '\v(^ [|*]( *[\\|_/\*])* )@<=[^*|].*$'
\ contains=VundleCommitMerge,VundleCommitUser,VundleCommitTime
highlight link VundleCommitLine String
" Sub-regions inside the commit message.
@@ -32,5 +32,5 @@ highlight link VundleCommitTime Comment
" The git history DAG markers are outside of the main commit line region.
" Note that this regex is intimately related to the one for VundleCommitLine,
" and the two should be changed in sync.
-syntax match VundleCommitTree '\v(^ )@<=[|*]( *[\\|/\*])*'
+syntax match VundleCommitTree '\v(^ )@<=[|*]( *[\\|_/\*])*'
highlight link VundleCommitTree Label
15 changes: 15 additions & 0 deletions ftplugin/vundlechangelog.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
" ---------------------------------------------------------------------------
" Standard ftplugin boilerplate; see ':help ftplugin'.
" ---------------------------------------------------------------------------
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1


" ---------------------------------------------------------------------------
" Settings for the Vundle update log buffer.
" ---------------------------------------------------------------------------
setlocal textwidth=0
setlocal nowrap
setlocal noswapfile
3 changes: 1 addition & 2 deletions ftplugin/vundlelog.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ let b:did_ftplugin = 1


" ---------------------------------------------------------------------------
" Settings for the Vundle update log buffer.
" Settings for the Vundle log buffer.
" ---------------------------------------------------------------------------
setlocal textwidth=0
setlocal nowrap
setlocal noswapfile
36 changes: 36 additions & 0 deletions syntax/vundlechangelog.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
" ---------------------------------------------------------------------------
" Syntax highlighting for the line which identifies the plugin.
" ---------------------------------------------------------------------------
syntax match VundlePluginName '\v(^Updated Plugin: )@<=.*$'
highlight link VundlePluginName Keyword

" ---------------------------------------------------------------------------
" Syntax highlighting for the 'compare at' line of each plugin.
" ---------------------------------------------------------------------------
syntax region VundleCompareLine start='\v^Compare at: https:' end='\v\n'
\ contains=VundleCompareUrl
syntax match VundleCompareUrl '\vhttps:\S+'
highlight link VundleCompareLine Comment
highlight link VundleCompareUrl Underlined

" ---------------------------------------------------------------------------
" Syntax highlighting for individual commits.
" ---------------------------------------------------------------------------
" The main commit line.
" Note that this regex is intimately related to the one for VundleCommitTree,
" and the two should be changed in sync.
syntax match VundleCommitLine '\v(^ [|*]( *[\\|_/\*])* )@<=[^*|].*$'
\ contains=VundleCommitMerge,VundleCommitUser,VundleCommitTime
highlight link VundleCommitLine String
" Sub-regions inside the commit message.
syntax match VundleCommitMerge '\v Merge pull request #\d+.*'
syntax match VundleCommitUser '\v( )@<=\S+( \S+)*(, \d+ \w+ ago$)@='
syntax match VundleCommitTime '\v(, )@<=\d+ \w+ ago$'
highlight link VundleCommitMerge Ignore
highlight link VundleCommitUser Identifier
highlight link VundleCommitTime Comment
" The git history DAG markers are outside of the main commit line region.
" Note that this regex is intimately related to the one for VundleCommitLine,
" and the two should be changed in sync.
syntax match VundleCommitTree '\v(^ )@<=[|*]( *[\\|_/\*])*'
highlight link VundleCommitTree Label
58 changes: 32 additions & 26 deletions syntax/vundlelog.vim
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
" ---------------------------------------------------------------------------
" Syntax highlighting for the line which identifies the plugin.
" ---------------------------------------------------------------------------
syntax match VundlePluginName '\v(^Updated Plugin: )@<=.*$'
syntax match VundlePluginName '\v\C(Plugin )@<=\S+/\S+(\s|$)'
highlight link VundlePluginName Keyword

" ---------------------------------------------------------------------------
" Syntax highlighting for the 'compare at' line of each plugin.
" Syntax highlighting for diffs on each plugin
" ---------------------------------------------------------------------------
syntax region VundleCompareLine start='\v^Compare at: https:' end='\v\n'
\ contains=VundleCompareUrl
syntax match VundleCompareUrl '\vhttps:\S+'
highlight link VundleCompareLine Comment
highlight link VundleCompareUrl Underlined
syntax match VundleGitAddition '\v(\|\s*\d+ )@<=\++'
highlight VundleGitAddition guifg=darkgreen guibg=NONE gui=bold
\ ctermfg=darkgreen ctermbg=NONE cterm=bold

syntax match VundleGitDeletion '\v(\|\s*\d+ \+*)@<=-+'
highlight VundleGitDeletion guifg=red guibg=NONE gui=bold ctermfg=red
\ ctermbg=NONE cterm=bold

" ---------------------------------------------------------------------------
" Syntax highlighting for individual commits.
" Syntax highlighting for log-specific features
" ---------------------------------------------------------------------------
" The main commit line.
" Note that this regex is intimately related to the one for VundleCommitTree,
" and the two should be changed in sync.
syntax match VundleCommitLine '\v(^ [|*]( *[\\|_/\*])* )@<=[^*|].*$'
\ contains=VundleCommitMerge,VundleCommitUser,VundleCommitTime
highlight link VundleCommitLine String
" Sub-regions inside the commit message.
syntax match VundleCommitMerge '\v Merge pull request #\d+.*'
syntax match VundleCommitUser '\v( )@<=\S+( \S+)*(, \d+ \w+ ago$)@='
syntax match VundleCommitTime '\v(, )@<=\d+ \w+ ago$'
highlight link VundleCommitMerge Ignore
highlight link VundleCommitUser Identifier
highlight link VundleCommitTime Comment
" The git history DAG markers are outside of the main commit line region.
" Note that this regex is intimately related to the one for VundleCommitLine,
" and the two should be changed in sync.
syntax match VundleCommitTree '\v(^ )@<=[|*]( *[\\|_/\*])*'
highlight link VundleCommitTree Label
syntax match VundleCaret '\V >'
highlight link VundleCaret Label

" Make path to tags file stand out
syntax match VundleTagPath '\v\C(:helptags )@<=/\S+$'
highlight link VundleTagPath Comment

" Make URL stand out
syntax match VundleCompareUrl '\v\Chttps:\S+'
highlight link VundleCompareUrl Underlined

" Make errors (from git) stand out
syntax match VundleError '\v\C( \> )@<=fatal:.*$'
highlight link VundleError Error

" Make git messages stand out
syntax match VundleGitMsg '\v\C( \> )@<=git:.*$'
highlight link VundleGitMsg Type

" De-emphasize the time stamp
syntax match VundleTimeStamp '\m^\[\d\{4}-\d\{2}-\d\{2} \d\{2}:\d\{2}:\d\{2}]'
highlight link VundleTimeStamp String