I'm afraid I attached the wrong version, here is the correct one.
#!/bin/bash
iodir=/tmp/fgsplit
echo 'Splitting FGDATA in 10 Seconds - Press Ctrl-C to cancel!'
echo ' !!!! WARNING !!!!'
echo 'Make _ABSOLUTELY SURE_ that you are in the right repository'
echo 'Running this script in a wrong repository will have unpredictable'
echo 'results! FURTHERMORE make sure to have'
echo " $iodir"
echo 'mounted as tmpfs with all the storage that you can spare'
echo ' ==== NOTE ===='
echo '_NO_ irreversible changes will be made to your local repository'
echo 'The resulting "split" repositories after the spit can be found in'
echo ' ../split_fgdata_result/'
echo 'and'
echo ' ../split_airplanes_result/'
echo 'If satisfied with the results you can then delete this very repo'
echo 'Which will, of course, seal the deal and make it irreversible'
sleep 10;
if ! git status ; then
echo ERROR - Please navigate into the root of the FGDATA repository
exit
fi
final_ac="../split_airplanes_result/"
final_fg="../split_fgdata_result/"
mkdir $final_ac
mkdir $final_fg
origin=$(pwd)
sleep 1
echo Bringing up to date
git pull
echo Going onto canonical master
git checkout origin/master
echo Creating branches for all aircrafts, hang on
for acf in ./Aircraft/* ; do
ac=${acf#./Aircraft/}
if [[ "$ac" == "Generic" || "$ac" == "Instruments" || "$ac" ==
"Instruments-3d" ]] ; then
continue ;
fi
echo Going onto canonical master
#git checkout origin/master
echo "Branching for $ac" ;
acbn=SPLIT-$ac
git branch "$acbn"
echo "Switching...";
git checkout $acbn
echo "Isolating...";
git filter-branch --subdirectory-filter /Aircraft/$ac
(
echo "Creating new (bare) repository for $ac..."
cd $final_ac
mkdir $ac
cd $ac
git init --bare
echo "Extracting..."
git fetch $origin $acbn
git branch master FETCH_HEAD
)
done
echo Going onto canonical master
git checkout origin/master
echo "Branching for reduced FGDATA"
git branch "SPLIT-CORE"
echo "Reducing..."
git filter-branch --index-filter 'git rm --cached --ignore-unmatch /Aircraft/*'
(
cd $final_fg
echo "Creating new (bare) repository for fgdata"
git init --bare
echo "Extracting..."
git fetch $origin SPLIT-CORE
git branch master FETCH_HEAD
)
echo "DONE"
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel