git-migration: pld-git.sh - switch using cvs2git

glen glen at pld-linux.org
Wed Feb 9 21:32:09 CET 2011


Author: glen                         Date: Wed Feb  9 20:32:09 2011 GMT
Module: git-migration                 Tag: HEAD
---- Log message:
- switch using cvs2git

---- Files affected:
git-migration:
   pld-git.sh (1.15 -> 1.16) 

---- Diffs:

================================================================
Index: git-migration/pld-git.sh
diff -u git-migration/pld-git.sh:1.15 git-migration/pld-git.sh:1.16
--- git-migration/pld-git.sh:1.15	Wed Feb  9 18:24:23 2011
+++ git-migration/pld-git.sh	Wed Feb  9 21:32:04 2011
@@ -94,12 +94,12 @@
 	cvs_pkgs
 
 	touch cvs.blacklist
-	install -d $gitdir
+	install -d $gitdir cvs2svn-tmp
 	for pkg in ${@:-$(cat cvs.pkgs)}; do
 		grep -qF $pkg cvs.blacklist && continue
 
-		# faster startup, skip existing ones for now
-		test -d $gitdir/$pkg && continue
+		# can't resume, drop old efforts
+		rm -rf $gitdir/$pkg
 
 		export GIT_DIR=$gitdir/$pkg
 		git init
@@ -107,6 +107,12 @@
 		git fast-import --export-marks=cvs2svn-tmp/cvs2git.marks < cvs2svn-tmp/git-blob.dat
 		git fast-import --import-marks=cvs2svn-tmp/cvs2git.marks < cvs2svn-tmp/git-dump.dat
 		./cvs2git_fixes.sh $pkg
+		# add origin remote
+		git remote add origin git at github.com:pld-linux/$pkg.git
+		# do some space
+		git repack -a -d
+		> $GIT_DIR/description
+		rm -f $GIT_DIR/hooks/*
 		unset GIT_DIR
 	done
 }
@@ -115,7 +121,6 @@
 # input: $CVSROOT
 # input: cvs.pkgs = list of packages
 # modifies: cvs.blacklist = list of problematic packages
-# conflicts with import_cvs2git
 import_git-cvsimport() {
 	set -$d
 	local pkg
@@ -173,10 +178,11 @@
 }
 
 # setup bare git repo for each imported git repo
+# i.e repos that should be used for serving git service
 # input: cvs.pkgs = list of packages
 git_bare() {
 	set -$d
-	local pkg
+	local pkg gitdir=git-import
 
 	git_templates
 	cvs_pkgs
@@ -185,10 +191,10 @@
 		grep -qF $pkg cvs.blacklist && continue
 		grep -qF $pkg git.blacklist && continue
 
-		test -d git-import/$pkg
+		test -d $gitdir/$pkg
 
 		rm -rf gitroot/$pkg
-		git clone --bare --template=templates git-import/$pkg gitroot/$pkg || echo $pkg >> git.blacklist
+		git clone --bare --mirror --template=templates git-import/$pkg gitroot/$pkg || echo $pkg >> git.blacklist
 	done
 }
 
@@ -250,11 +256,12 @@
 
 cvs_rsync
 
-import_git-cvsimport "$@"
-#import_cvs2git "$@"
+#import_git-cvsimport "$@"
+import_cvs2git "$@"
+#git_rewrite_commitlogs "$@"
 
 # missingusers needed only to analyze missing users file
 #git_missingusers
 
-git_bare "$@"
-git_rewrite_commitlogs "$@"
+# do not need bare repo, if all we do is push to github
+#git_bare "$@"
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/git-migration/pld-git.sh?r1=1.15&r2=1.16&f=u



More information about the pld-cvs-commit mailing list