Skip to content

Instantly share code, notes, and snippets.

@BrandonSmith
Created April 28, 2009 19:02
Show Gist options
  • Save BrandonSmith/103315 to your computer and use it in GitHub Desktop.
Save BrandonSmith/103315 to your computer and use it in GitHub Desktop.
Updates listed git svn submodules. I am sure there is a more generic way to accomplish this, but it works for my needs.
#!/bin/sh
ROOT=/Volumes/git
#SM_ROOT=zero
#SM_SUBMODULES=( CORE/dojo )
AB_ROOT=appbuilder
AB_SUBMODULES=( BUILD/zero.build BUILD/zero.docs BUILD/zero.findbugs.ext BUILD/zero.infocenter.build BUILD/zero.infocenter.feature BUILD/zero.infocenter.updatesite )
SUBMODULES=(${AB_SUBMODULES[@]}) # ${SM_SUBMODULES[@]}
ORIGIN_PWD="${PWD}"
cd $ROOT
ELEMENTS=${#SUBMODULES[@]}
for (( i=0;i<$ELEMENTS;i++)); do
directory="${ROOT}/${AB_ROOT}/${SUBMODULES[${i}]}"
if [ -d $directory ]; then
echo "Updating ${directory} ..."
cd $directory && git svn rebase && cd $ORIGIN_PWD
else
echo "${directory} does not exists"
fi
done
cd $ORIGIN_PWD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment