Created
March 10, 2011 22:52
-
-
Save azatoth/865120 to your computer and use it in GitHub Desktop.
Splits the github mediawiki extension copy repository into one repo per extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script takes the mediawiki trunk extension git repository and splits them into one | |
# repository for each extension | |
# | |
# Warning: this can take some time | |
# | |
# Specify the path to your copy of the extension repo below: | |
MW_EXT_GIT=$HOME/public_html/mediawiki-trunk-extensions | |
for module in $(find $MW_EXT_GIT/* -maxdepth 0 -type d -exec basename {} \;); do | |
tmpdir=$(mktemp -d --tmpdir=$PWD); # should be same device due to hardlinks | |
git clone $MW_EXT_GIT $tmpdir; | |
cd $tmpdir; | |
git filter-branch \ | |
--prune-empty \ | |
--subdirectory-filter $module \ | |
--msg-filter 'sed -e "/^git-svn-id:/d"' \ | |
HEAD; | |
cd ..; | |
git clone file://$tmpdir $module; | |
cd $module; | |
git remote rm origin; | |
git gc --aggressive --prune=now; | |
cd ..; | |
rm -rf $tmpdir; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment