Skip to content

Instantly share code, notes, and snippets.

@shippy
Last active April 12, 2017 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shippy/672507b5258028c03c80f4f75f3af1cf to your computer and use it in GitHub Desktop.
Save shippy/672507b5258028c03c80f4f75f3af1cf to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# A script to replicate VundleVim/Vundle.vim/issues/807
## Setup
cd /tmp
rm -rf bugtest
mkdir bugtest && cd bugtest && git init
git submodule add -b vundle_bug https://github.com/shippy/dotvim.git dotvim
git submodule update --init --recursive
hook_path=".git/modules/dotvim/hooks/post-checkout"
echo "#!/usr/bin/env bash" > $hook_path
echo "echo 'Vundle update!'" >> $hook_path
exec vim -c VundleUpdate -c PluginClean! -c quitall &> /dev/null
# Use this instead if you wish to step through the code
# echo "exec vim -c 'debug VundleUpdate'" >> $hook_path
chmod +x $hook_path
## Make this the temporary vim config
mv ~/.vim ~/.vim_test
ln -s $(pwd)/dotvim ~/.vim
cd ~/.vim
## Demonstration
echo "dotvim remote is now $(git remote get-url origin)"
# Expected: https://github.com/shippy/dotvim.git
# Actual: https://github.com/shippy/dotvim.git
echo "Trigger post-checkout by re-checking out the current branch"
git checkout vundle_bug
echo "dotvim remote is now $(git remote get-url origin)"
# Expected: https://github.com/shippy/dotvim.git
# Actual: https://github.com/VundleVim/Vundle.vim.git
## Clean-up
rm -f ~/.vim
mv ~/.vim_test ~/.vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment