From cf67c85370a7e473ec6bfd7f4e44c857029cf93b Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Sat, 24 Aug 2013 15:39:56 -0400 Subject: [PATCH] remove command-t --- .gitmodules | 3 --- .vim/bundle/command-t | 1 - bin/git-remove-submodule | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) delete mode 160000 .vim/bundle/command-t create mode 100755 bin/git-remove-submodule diff --git a/.gitmodules b/.gitmodules index e20f15d..d06eb3d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,9 +28,6 @@ [submodule ".vim/bundle/nerdcommenter"] path = .vim/bundle/nerdcommenter url = git://github.com/scrooloose/nerdcommenter.git -[submodule ".vim/bundle/command-t"] - path = .vim/bundle/command-t - url = git://git.wincent.com/command-t.git [submodule ".vim/bundle/EasyGrep"] path = .vim/bundle/EasyGrep url = https://github.com/vim-scripts/EasyGrep.git diff --git a/.vim/bundle/command-t b/.vim/bundle/command-t deleted file mode 160000 index 8866bbc..0000000 --- a/.vim/bundle/command-t +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8866bbc0e18a981889b3431790caf47432f38cf4 diff --git a/bin/git-remove-submodule b/bin/git-remove-submodule new file mode 100755 index 0000000..d099727 --- /dev/null +++ b/bin/git-remove-submodule @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Adam Sharp +# Aug 21, 2013 +# +# Usage: Add it to your PATH and `git remove-submodule path/to/submodule`. +# +# Does the inverse of `git submodule add`: +# 1) `deinit` the submodule +# 2) Remove the submodule from the index and working directory +# 3) Clean up the .gitmodules file +# + +submodule_name=$1; shift + +exit_err() { + [ $# -gt 0 ] && echo "fatal: $*" 1>&2 + exit 1 +} + +if git submodule status "$submodule_name" >/dev/null 2>&1; then + git submodule deinit -f "$submodule_name" + git rm -f "$submodule_name" + + git config -f .gitmodules --remove-section "submodule.$submodule_name" + if [ -z "$(cat .gitmodules)" ]; then + git rm -f .gitmodules + else + git add .gitmodules + fi +else + exit_err "Submodule '$submodule_name' not found" +fi