sysvinit/contrib/migrate-svn-git
2018-02-12 06:23:20 +00:00

30 lines
716 B
Bash
Executable File

#!/bin/sh
#
# Script to migrate sysvinit project source code from subversion to git.
# Used february 2018.
authorsmap=$(tempfile)
cat > $authorsmap <<EOF
pere = Petter Reinholdtsen <pere@hungry.com>
wfink = Werner Fink <werner@suse.de>
EOF
for p in sysvinit startpar insserv; do
git svn clone http://svn.savannah.nongnu.org/svn/sysvinit/$p \
--authors-file=$authorsmap \
--no-metadata \
--tags=tags \
--trunk=trunk \
--prefix=$p/ \
$p-git
(
cd $p-git
for tag in `git branch -r | grep "tags/" | sed "s/ $p\/tags\///"`; do
git tag -a -m"Converting SVN tags" $tag refs/remotes/$p/tags/$tag
done
git remote add origin ssh://git.savannah.gnu.org:/srv/git/$p.git
)
done
rm $authorsmap