Skip to content

Commit

Permalink
script to create git repository from svn package
Browse files Browse the repository at this point in the history
  • Loading branch information
cweiske committed Aug 22, 2011
1 parent 15928d3 commit 4eafdf3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
*/
24 changes: 24 additions & 0 deletions package-to-git.sh
@@ -0,0 +1,24 @@
#!/bin/sh
# move a PEAR package to github
if [ -z "$1" ]; then
echo pass package name as only parameter
exit 1
fi
package=$1

firstrev=`svn log -q http://svn.php.net/repository/pear/packages/$package\
|tail -n2\
|head -n1\
|awk '{split($0,a," "); print a[1]}'\
|sed 's/r//'`
echo "First SVN revision: $firstrev"
git svn clone -s http://svn.php.net/repository/pear/packages/$package/\
-r $firstrev\
--authors-file=./authors.txt
cd $package
git svn rebase
git remote add origin git@github.com:pear/$package.git
echo "Visit https://github.com/pear/$package now"
echo "or create it at https://github.com/organizations/pear/repositories/new"
echo "then run"
echo "$ git push -u origin master"

0 comments on commit 4eafdf3

Please sign in to comment.