add git submodule
This commit is contained in:
parent
17594221eb
commit
af0a6d4f6b
3 changed files with 17 additions and 19 deletions
6
.gitmodules
vendored
6
.gitmodules
vendored
|
@ -1,12 +1,6 @@
|
|||
[submodule "tmux/plugins/tmux-sensible"]
|
||||
path = tmux/plugins/tmux-sensible
|
||||
url = git://git.schuerz.at/github.com/tmux-plugins/tmux-sensible.git
|
||||
[submodule "vim/bundle/Vundle.vim"]
|
||||
path = vim/bundle/Vundle.vim
|
||||
url = git://git.schuerz.at/github.com/gmarik/Vundle.vim.git
|
||||
[submodule "tmux/plugins/tpm"]
|
||||
path = tmux/plugins/tpm
|
||||
url = git://git.schuerz.at/github.com/tmux-plugins/tpm.git
|
||||
[submodule "tmux/plugins/tmux-themepack"]
|
||||
path = tmux/plugins/tmux-themepack
|
||||
url = git://git.schuerz.at/github.com/jimeh/tmux-themepack.git
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
SUBMODULE=$1
|
||||
git config --file=.gitmodules --remove-section submodule.${SUBMODULE} || \
|
||||
{ logerror "error on removing section from .gitmodules"; exit 1; }
|
||||
git commit .gitmodules -m "remove submodule $SUBMODULE from .gitconfig"
|
||||
git config --remove-section submodule.${SUBMODULE} || \
|
||||
{ logerror "error on removing section from .git/config"; exit 2; }
|
||||
git rm --cached "${SUBMODULE}" || \
|
||||
{ logerror "remove submodule from stage error"; exit 3; }
|
||||
[ -d ".git/modules/${SUBMODULE}" ] && rm -rf .git/modules/"${SUBMODULE}" || \
|
||||
{ logerror "error on removing submodule from unversioned .git/modules/*"; exit 4; }
|
||||
git commit -m "remove submodule ${SUBMODULE}"
|
||||
[ -d "${SUBMODULE}" ] && rm -rf "${SUBMODULE}" || \
|
||||
{ logerror "error on removing submodule from repo"; exit 5; }
|
||||
[[ $(git config --file=.gitmodules --get submodule.${SUBMODULE}.url >/dev/null 2>&1; echo $?) -eq 0 \
|
||||
|| $(git config --file=.gitmodules --get submodule.${SUBMODULE}.path >/dev/null 2>&1; echo $?) -eq 0 \
|
||||
|| $(git config --get submodule.${SUBMODULE}.url >/dev/null 2>&1; echo $?) -eq 0 \
|
||||
|| $(git config --get submodule.${SUBMODULE}.path >/dev/null 2>&1; echo $?) -eq 0 ]] || exit $?
|
||||
[[ $(git config --file=.gitmodules --get submodule.${SUBMODULE}.url >/dev/null 2>&1; echo $?) -eq 0 \
|
||||
|| $(git config --file=.gitmodules --get submodule.${SUBMODULE}.path >/dev/null 2>&1; echo $?) -eq 0 ]] && \
|
||||
loginfo "$(git config --file=.gitmodules --remove-section submodule.${SUBMODULE})"
|
||||
|
||||
#git commit .gitmodules -m "remove submodule $SUBMODULE from .gitconfig"
|
||||
[[ $(git config --get submodule.${SUBMODULE}.url >/dev/null 2>&1; echo $?) -eq 0 \
|
||||
|| $(git config --get submodule.${SUBMODULE}.path >/dev/null 2>&1; echo $?) -eq 0 ]] && \
|
||||
loginfo "$(git config --remove-section submodule.${SUBMODULE})"
|
||||
|
||||
loginfo "$(git rm --cached "${SUBMODULE}")"
|
||||
[ -d ".git/modules/${SUBMODULE}" ] && loginfo "$(rm -rf .git/modules/"${SUBMODULE}")"
|
||||
loginfo "$(git commit -m "remove submodule ${SUBMODULE}" )"
|
||||
[ -d "${SUBMODULE}" ] && loginfo "$(rm -rf ${SUBMODULE} )"
|
||||
loginfo "submodule $SUBMODULE completely removed"
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 1b1b8098419daacb92ca401ad6ee0ca6894a40ca
|
Loading…
Reference in a new issue