1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
#!/bin/sh
# This script splits out all the frameworks from kdelibs into separate repositories
# and puts them into ../frameworks/.
#
# For each framework, first it creates an empty repository and it imports the
# current code, into the original subdirectory. For example, kconfig will be a
# repository containing a tier1/kconfig/ directory. Then, in a second commit,
# the code is moved to the root directory of the repository.
#
# Doing the move in two steps like this lets git follow the history better.
# When the old kdelibs history is grafted on the new repositories, the history
# will contain a commit that deletes everything except that framework, and then
# another commit moving the framework to the root.
#
origproject=kdelibs
origbranch=frameworks
origsha1=`git rev-parse HEAD`
if [ ! -d tier1 ]; then
echo "Run this script from the toplevel of the monolithic repository, there must be a tier1 subdirectory"
exit 1
fi
dest=../frameworks
mkdir -p $dest
here=$PWD
for dir in tier1/* tier2/* tier3/* tier4/*; do
cd $here
if [ -f $dir ]; then
continue;
fi
frameworkname=`basename $dir`
frameworkdest=$dest/$frameworkname
rm -rf $frameworkdest
# eg. create ../frameworks/kjs/tier1
mkdir -p $(dirname $frameworkdest/$dir)
# eg. copy tier1/kjs to ../frameworks/kjs/tier1/kjs
cp -a $dir $frameworkdest/$dir/
cd $frameworkdest
git init
git add .
git commit -q -F - <<EOF
Initial import from the monolithic $origproject.
This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
techbase wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:
http://community.kde.org/Frameworks/GitOldHistory
If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.
Branched from the monolithic repo, $origproject $origbranch branch, at commit
$origsha1
EOF
# eg. moves tier1/kconfig/* to .
git mv $dir/* .
git commit -q -m "Move $frameworkname code to the root directory."
echo "$frameworkdest done."
done
|