[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Converting a proprietary svn repository to git

From: Greg Chicares
Subject: [lmi] Converting a proprietary svn repository to git
Date: Fri, 26 Feb 2016 00:17:43 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0

Vadim--do you see any real reason not to use 'git svn' in this case,
particularly with '--no-metadata'?

We have an svn repository of proprietary information that we want to
convert to git. It's linear--no branches, and no tags. Our habit has
been to refer to commits by datestamp, not revision number. This is a
one-way migration: we'll never use svn for this repository again. It
doesn't make sense to discard history, but because of the nature of
the contents we will rarely have any reason to refer to old history.

I've used a sequence of commands [0] that does seem to work. However,
there's less than universal agreement that this is the best way:
  Don’t do svn-to-git repository conversions with git-svn!

Anyway, I was searching for any reason not to use '--no-metadata'
when I found that you contributed to its documentation:
I have no '.git/svn/**/.rev_map.*' files.


[0] "sequence of commands":

# set insurer's domain
/home/greg[0]$export CompanyDomain="example.com"
/home/greg[0]$[ "example.com" = "$CompanyDomain" ] && echo "YOU WERE SUPPOSED 

# "tainted" just means it's neither free, nor mine
/home/greg[0]$mkdir --parents tainted/migration
/home/greg[0]$cd tainted/migration

# unpack svn tarball and verify it
/home/greg/tainted/migration[0]$tar -xjvf repository-20160212T2239Z.tar.bz2
/home/greg/tainted/migration[0]$svnadmin verify repository

# get authors
/home/greg/tainted/migration[0]$mkdir svn_working_copy
/home/greg/tainted/migration[0]$cd svn_working_copy
/home/greg/tainted/migration/svn_working_copy[0]$svn checkout \
/home/greg/tainted/migration/svn_working_copy[0]$cd repository
/home/greg/tainted/migration/svn_working_copy/repository[0]$svn log --xml \
  | grep author | sort -u \
  | sed -e "s/^[^>]*>\([^<]*\)<[^<]*$/\1 = \1 <address@hidden>/" \

# convert svn to git
/home/greg/tainted/migration/svn_working_copy/repository[0]$cd ../..
/home/greg/tainted/migration[0]$git svn clone \
  file:///home/greg/tainted/migration/repository \
  --authors-file=authors.txt --no-metadata --trunk=/ ./proprietary

reply via email to

[Prev in Thread] Current Thread [Next in Thread]