Skip to content

Instantly share code, notes, and snippets.

@dgolovin
Last active August 29, 2015 13:57
Show Gist options
  • Save dgolovin/9905663 to your computer and use it in GitHub Desktop.
Save dgolovin/9905663 to your computer and use it in GitHub Desktop.
extract browsersim from vpe repository
set -f
git clone git@github.com:dgolovin/jbosstools-browsersim-final.git
git clone git@github.com:jbosstools/jbosstools-vpe.git jbosstools-vpe-tmp
cd jbosstools-vpe-tmp
# remove all tags
git tag -l | xargs git tag -d
# there is no reason to delete branches, because only master is cloned
treeFilter=$( cat <<EOF
features/org.jboss.tools.vpe.feature/*
features/org.jboss.tools.vpe.test.feature/*
features/org.jboss.tools.xulrunner.feature/*
features/org.jboss.tools.vpe.cordovasim.feature/*
features/org.jboss.tools.vpe.vpv.feature/*
plugins/org.jboss.tools.vpe/*
plugins/org.jboss.tools.vpe.docbook/*
plugins/org.jboss.tools.vpe.html/*
plugins/org.jboss.tools.vpe.jsp/*
plugins/org.jboss.tools.vpe.resref/*
plugins/org.jboss.tools.vpe.spring/*
plugins/org.jboss.tools.vpe.ui.palette/*
plugins/org.jboss.tools.vpe.xulrunner/*
plugins/org.jboss.tools.vpe.cordovasim*
plugins/org.jboss.tools.xulrunner/*
plugins/org.jboss.tools.xulrunner.initializer/*
plugins/org.jboss.tools.vpe.vpv/*
tests/org.jboss.tools.vpe.base.test/*
tests/org.jboss.tools.vpe.docbook.test/*
tests/org.jboss.tools.vpe.html.test/*
tests/org.jboss.tools.vpe.jsp.test/*
tests/org.jboss.tools.vpe.spring.test/*
tests/org.jboss.tools.vpe.test/*
tests/org.jboss.tools.vpe.ui.test/*
tests/org.jboss.tools.vpe.xulrunner.test/*
EOF
)
treeFilter=$( echo $treeFilter | tr -d '\r' | tr -d '\n' )
indexFilter=${treeFilter//\*/\\\*}
indexOnlyFilter=$( cat <<EOF
images/\*
.gitmodules
cordova/\*
accelerometer.html
cache.manifest
cordova-2.2.0.js
package.json
browsersim-standalone/\*
tests/org.jboss.tools.vpe.ui.bot.test/\*
plugins/org.jboss.tools.vpe.base.test/\*
releng/\*
plugins/org.jboss.tools.common.resref/\*
tests/org.jboss.tools.jsf.vpe.html.test/\*
tests/org.jboss.tools.jsf.vpe.jsp.test/\*
tests/org.jboss.tools.jsf.vpe.jsf.test/\*
tests/org.jboss.tools.vpe.mozilla.test/\*
tests/org.jboss.tools.vpe.test.richfaces/\*
plugins/org.jboss.tools.vpe.mozilla.gtk/\*
plugins/org.jboss.tools.vpe.mozilla.win32/\*
plugins/org.jboss.tools.vpe.mozilla/\*
plugins/org.jboss.tools.vpe.ui/\*
plugins/by.buziuk.di/\*
plugins/org.jboss.tools.vpe.vpv.core/\*
EOF
)
# Required to remove EOL's from stings or git would fail
indexOnlyFilter=$( echo $indexOnlyFilter | tr -d '\r' | tr -d '\n' )
git filter-branch --force --index-filter "git rm -rf --cached --ignore-unmatch $indexFilter" --prune-empty HEAD
git filter-branch --force --tree-filter "rm -rf $treeFilter" --prune-empty HEAD
git filter-branch --force --index-filter "git rm -rf --cached --ignore-unmatch $indexOnlyFilter" --prune-empty HEAD
cd ../jbosstools-browsersim-final
git pull ../jbosstools-vpe-tmp
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment