Skip to content

Instantly share code, notes, and snippets.

@robstryker
Last active October 17, 2017 14:38
Show Gist options
  • Save robstryker/e4856a8ef28d8673664e4e2759f21524 to your computer and use it in GitHub Desktop.
Save robstryker/e4856a8ef28d8673664e4e2759f21524 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# move org.eclipse.jst.common.ui plugin into javaee
START_TIME=`date +%s`
# in case we have another alias for mv, like 'mv -i'
alias mv=mv
# set our local pull command depending on git version
verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
verlt() {
[ "$1" = "$2" ] && return 1 || verlte $1 $2
}
GIT_VERSION=`git version | head -1 | cut -f 3 -d " "`
verlte $GIT_VERSION 2.9.0 && ALLOW_PULL_FLAG=false || ALLOW_PULL_FLAG=true
if $ALLOW_PULL_FLAG
then
LOCAL_PULL_CMD="git pull --no-edit --allow-unrelated-histories"
else
LOCAL_PULL_CMD="git pull --no-edit "
fi
# handle changes to parent pom
git clone http://git.eclipse.org/gitroot/webtools/webtools.releng.aggregator.git
cd webtools.releng.aggregator
#git fetch https://git.eclipse.org/r/webtools/webtools.releng.aggregator refs/changes/73/100873/1 && git checkout FETCH_HEAD
cd wtp-parent
mvn clean install
cd ../../
git clone http://git.eclipse.org/gitroot/webtools-common/webtools.common.git
cd webtools.common
git remote rm origin
git filter-branch --subdirectory-filter plugins/org.eclipse.jst.common.ui -- --all
mkdir plugins; mkdir plugins/org.eclipse.jst.common.ui
mv * plugins/org.eclipse.jst.common.ui/
mv .classpath plugins/org.eclipse.jst.common.ui/
mv .project plugins/org.eclipse.jst.common.ui/
mv .settings plugins/org.eclipse.jst.common.ui/
git add plugins
git commit -a -m "[519716] - filter branch, move org.eclipse.jst.common.ui to jeetools"
cd ../
git clone http://git.eclipse.org/gitroot/jeetools/webtools.javaee.git
cd webtools.javaee
$LOCAL_PULL_CMD ../webtools.common/
cat pom.xml | head -n 58 > pom2.xml
echo " <module>plugins/org.eclipse.jst.common.ui</module>" >> pom2.xml
cat pom.xml | tail -n +59 >> pom2.xml
mv pom2.xml pom.xml
git workprofile
git commit -a -m "Fix root pom to include new plugin" --signoff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment