[Pkg-ocaml-maint-commits] r5327 - /trunk/tools/svn2git/svn2git_alioth

zack at users.alioth.debian.org zack at users.alioth.debian.org
Mon Mar 17 13:51:29 UTC 2008


Author: zack
Date: Mon Mar 17 13:51:29 2008
New Revision: 5327

URL: http://svn.debian.org/wsvn/?sc=1&rev=5327
Log:
add support for removing .tar.gz tarballs from the history

Modified:
    trunk/tools/svn2git/svn2git_alioth

Modified: trunk/tools/svn2git/svn2git_alioth
URL: http://svn.debian.org/wsvn/trunk/tools/svn2git/svn2git_alioth?rev=5327&op=diff
==============================================================================
--- trunk/tools/svn2git/svn2git_alioth (original)
+++ trunk/tools/svn2git/svn2git_alioth Mon Mar 17 13:51:29 2008
@@ -11,6 +11,8 @@
 # $Id$
 
 set -e
+
+TGZ_PATTERN="*.tar.gz"	# find (-name) syntax
 
 usage () {
   echo "Usage:   svn2git_alioth TRUNK_URL BRANCHES_URL TAGS_URL DESTDIR"
@@ -73,6 +75,12 @@
   done)
 }
 
+rm_tarballs () {
+  info " remove .tar.gz tarballs from git history"
+  (cd "$wdir"
+  git filter-branch --tree-filter "find . -name \"$TGZ_PATTERN\" -exec rm {} \;" HEAD)
+}
+
 clean_repo () {
   info " generic git repository clean up + making it bare"
   (cd $wdir
@@ -83,13 +91,14 @@
   mv $wdir/.git/ "$DESTDIR"
   rm -rf $wdir
   (cd "$DESTDIR"
-  git gc)
+  git gc --prune --aggressive)
 }
 
 
 [ -z "$NO_INIT" ] && git_svninit
 [ -z "$NO_FETCH" ] && gitsvn_fetch
 [ -z "$NO_BRANCHFIX" ] && fix_branches
+[ -z "$NO_TARBALLS" ] && rm_tarballs
 if [ -z "$NO_CLEAN" ] ; then
   clean_repo
 else




More information about the Pkg-ocaml-maint-commits mailing list