diff options
Diffstat (limited to 'scripts/switch_all_submodules_to_head_and_clean')
m--------- | scripts | 0 | ||||
-rwxr-xr-x | scripts/switch_all_submodules_to_head_and_clean | 60 |
2 files changed, 0 insertions, 60 deletions
diff --git a/scripts b/scripts new file mode 160000 +Subproject b0a915240f92352cf9675146940d045f76ee774 diff --git a/scripts/switch_all_submodules_to_head_and_clean b/scripts/switch_all_submodules_to_head_and_clean deleted file mode 100755 index 631381272..000000000 --- a/scripts/switch_all_submodules_to_head_and_clean +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -if [[ ! -e .git ]] || - [[ -z "`git rev-parse --git-dir 2>/dev/null`" ]]; then - echo "This script can only be run from a top level git directory. Exiting..." - exit 1 -fi - -branch=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"` -if [[ -z "$branch" ]] || - [[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then - echo "There is not active upstream branch. Exiting..." - exit 1 -fi - -echo "Preparing $PWD for development use" -if [[ $1 == "" ]]; then - gituser=`sed -n "/^\[remote \"origin\"\]/,/url/s/\turl = http:\/\/\([^@]*\)@.*/\1/p" <\`git rev-parse --git-dir\`/config | grep -v "\(anonymous\|system\)"` -else - gituser=$1 -fi - -if [[ $gituser == "" ]]; then - read -p "Enter your TDE GIT username []: " -e gituser -fi - -if [[ $gituser == "" ]]; then - gituser="anonymous" -fi - -THISSCRIPT=$(readlink -f $0) - -if [[ ! -e "$THISSCRIPT" ]]; then - echo "Unable to find myself! Exiting..." - exit 1 -fi - -if [[ ! -z "`git status --porcelain`" ]]; then - git reset --hard HEAD - git clean -dxff -fi -git pull -if [[ ! -z "`git status --porcelain`" ]]; then - git reset --hard HEAD - git clean -dxff -fi - -if [[ -e .gitmodules ]]; then - if [[ $gituser == "anonymous" ]]; then - sed -i 's/system@//g' .gitmodules - else - sed -i "s/system@/$gituser@/g" .gitmodules - fi - - git submodule init - git submodule update - git submodule foreach "git checkout $branch && $THISSCRIPT $gituser" - - git checkout -- .gitmodules -fi |