add git submodule

This commit is contained in:
Jakobus Schürz 2020-10-30 00:46:59 +01:00
parent 17594221eb
commit af0a6d4f6b
3 changed files with 17 additions and 19 deletions

6
.gitmodules vendored
View file

@ -1,12 +1,6 @@
[submodule "tmux/plugins/tmux-sensible"] [submodule "tmux/plugins/tmux-sensible"]
path = tmux/plugins/tmux-sensible path = tmux/plugins/tmux-sensible
url = git://git.schuerz.at/github.com/tmux-plugins/tmux-sensible.git 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"] [submodule "tmux/plugins/tpm"]
path = tmux/plugins/tpm path = tmux/plugins/tpm
url = git://git.schuerz.at/github.com/tmux-plugins/tpm.git 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

View file

@ -1,17 +1,22 @@
#!/bin/bash #!/bin/bash
SUBMODULE=$1 SUBMODULE=$1
git config --file=.gitmodules --remove-section submodule.${SUBMODULE} || \ [[ $(git config --file=.gitmodules --get submodule.${SUBMODULE}.url >/dev/null 2>&1; echo $?) -eq 0 \
{ logerror "error on removing section from .gitmodules"; exit 1; } || $(git config --file=.gitmodules --get submodule.${SUBMODULE}.path >/dev/null 2>&1; echo $?) -eq 0 \
git commit .gitmodules -m "remove submodule $SUBMODULE from .gitconfig" || $(git config --get submodule.${SUBMODULE}.url >/dev/null 2>&1; echo $?) -eq 0 \
git config --remove-section submodule.${SUBMODULE} || \ || $(git config --get submodule.${SUBMODULE}.path >/dev/null 2>&1; echo $?) -eq 0 ]] || exit $?
{ logerror "error on removing section from .git/config"; exit 2; } [[ $(git config --file=.gitmodules --get submodule.${SUBMODULE}.url >/dev/null 2>&1; echo $?) -eq 0 \
git rm --cached "${SUBMODULE}" || \ || $(git config --file=.gitmodules --get submodule.${SUBMODULE}.path >/dev/null 2>&1; echo $?) -eq 0 ]] && \
{ logerror "remove submodule from stage error"; exit 3; } loginfo "$(git config --file=.gitmodules --remove-section submodule.${SUBMODULE})"
[ -d ".git/modules/${SUBMODULE}" ] && rm -rf .git/modules/"${SUBMODULE}" || \
{ logerror "error on removing submodule from unversioned .git/modules/*"; exit 4; } #git commit .gitmodules -m "remove submodule $SUBMODULE from .gitconfig"
git commit -m "remove submodule ${SUBMODULE}" [[ $(git config --get submodule.${SUBMODULE}.url >/dev/null 2>&1; echo $?) -eq 0 \
[ -d "${SUBMODULE}" ] && rm -rf "${SUBMODULE}" || \ || $(git config --get submodule.${SUBMODULE}.path >/dev/null 2>&1; echo $?) -eq 0 ]] && \
{ logerror "error on removing submodule from repo"; exit 5; } 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" loginfo "submodule $SUBMODULE completely removed"

@ -1 +0,0 @@
Subproject commit 1b1b8098419daacb92ca401ad6ee0ca6894a40ca