Permalink
Browse files

script to create git repository from svn package

  • Loading branch information...
1 parent 15928d3 commit 4eafdf33c54ff50c78954503613dff85531e1e04 @cweiske cweiske committed Aug 22, 2011
Showing with 25 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +24 −0 package-to-git.sh
View
@@ -0,0 +1 @@
+*/
View
@@ -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.