From af0a6d4f6bbb1eb112bfc9a0e13187a1ce44e103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Fri, 30 Oct 2020 00:46:59 +0100 Subject: [PATCH] add git submodule --- .gitmodules | 6 ------ bin/git-submodule-remove | 29 +++++++++++++++++------------ tmux/plugins/tmux-themepack | 1 - 3 files changed, 17 insertions(+), 19 deletions(-) delete mode 160000 tmux/plugins/tmux-themepack diff --git a/.gitmodules b/.gitmodules index 606c8ce..0595435 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/bin/git-submodule-remove b/bin/git-submodule-remove index 4ec2237..6233dc9 100755 --- a/bin/git-submodule-remove +++ b/bin/git-submodule-remove @@ -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" diff --git a/tmux/plugins/tmux-themepack b/tmux/plugins/tmux-themepack deleted file mode 160000 index 1b1b809..0000000 --- a/tmux/plugins/tmux-themepack +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1b1b8098419daacb92ca401ad6ee0ca6894a40ca