From jdo-commits-return-3459-archive-asf-public=cust-asf.ponee.io@db.apache.org Sun Jul 22 21:40:55 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 28A9518062F for ; Sun, 22 Jul 2018 21:40:54 +0200 (CEST) Received: (qmail 69864 invoked by uid 500); 22 Jul 2018 19:40:54 -0000 Mailing-List: contact jdo-commits-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-commits@db.apache.org Received: (qmail 69855 invoked by uid 99); 22 Jul 2018 19:40:54 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jul 2018 19:40:54 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 8A5233A0102 for ; Sun, 22 Jul 2018 19:40:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1836454 - in /db/jdo: authors-transform.txt svn2git.html Date: Sun, 22 Jul 2018 19:40:53 -0000 To: jdo-commits@db.apache.org From: mbo@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20180722194053.8A5233A0102@svn01-us-west.apache.org> Author: mbo Date: Sun Jul 22 19:40:52 2018 New Revision: 1836454 URL: http://svn.apache.org/viewvc?rev=1836454&view=rev Log: JDO-770 svn2git description Added: db/jdo/authors-transform.txt db/jdo/svn2git.html Added: db/jdo/authors-transform.txt URL: http://svn.apache.org/viewvc/db/jdo/authors-transform.txt?rev=1836454&view=auto ============================================================================== --- db/jdo/authors-transform.txt (added) +++ db/jdo/authors-transform.txt Sun Jul 22 19:40:52 2018 @@ -0,0 +1,11 @@ +andyj = Andy Jefferson +bayard = Henri Yandell +brazil = Michael Watzek +brianm = Brian McCallister +btopping = Brian Topping +clr = Craig L Russell +geirm = Geir Magnusson Jr +madams = Matthew T. Adams +mbo = Michael Bouschen +mcaisse = Michelle Caisse +mzaun = Martin Zaun Added: db/jdo/svn2git.html URL: http://svn.apache.org/viewvc/db/jdo/svn2git.html?rev=1836454&view=auto ============================================================================== --- db/jdo/svn2git.html (added) +++ db/jdo/svn2git.html Sun Jul 22 19:40:52 2018 @@ -0,0 +1,99 @@ + + + + + + Converting a Subversion repository to Git + + + +

Converting a Subversion repository to Git

+The description is taken from John Albin's blog + +Converting a Subversion repository to Git. + +
    +
  1. Checkout the project in a new clean workspace +
    +% mkdir svn2git
    +% cd svn2git
    +% svn checkout https://svn.apache.org/repos/asf/db/jdo
    +    
    +
  2. +
  3. Retrieve a list of all Subversion committers +

    Run the following command that creates the file authors-transform.txt. Then edit authors-transform.txt and add full anme and email on each line.

    +
    % svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
    +
  4. +
  5. Clone the Subversion repository using git-svn +

    The following command will place the git repository in the "~/temp" folder inside your home directory. The command will fail, if there are authors not included in authors-transform.txt. Then you need to extend authors-transform.txt, remove the files being checked out so far and run thecommand again.

    +
    % git svn clone https://svn.apache.org/repos/asf/db/jdo --no-metadata -A authors-transform.txt --stdlayout ~/temp
    +
  6. +
  7. Convert svn:ignore properties to .gitignore +
  8. +
    % cd ~/temp
    +% git svn show-ignore > .gitignore
    +% git add .gitignore
    +% git commit -m 'Convert svn:ignore properties to .gitignore.'
    +    
    +
  9. Find empty directories +

    Git does not handle empty directories. That means they are removed after the migration from svn to git. If they are imporant for emaple for the build process you should create a file (e.g. README.txt) in the directory. +

  10. +
  11. Push repository to a bare git repository +

    Create a bare repository

    +
    % git init --bare ~/new-bare.git
    +% cd ~/new-bare.git
    +% git symbolic-ref HEAD refs/heads/trunk
    +    
    +

    Then push the temp repository to the new bare repository.

    +
    +% cd ~/temp
    +% git remote add bare ~/new-bare.git
    +% git config remote.bare.push 'refs/remotes/*:refs/heads/*'
    +% git push bare
    +% rm -rf ~/temp
    +    
    +
  12. +
  13. Rename "trunk" branch to "master" +
    +% cd ~/new-bare.git
    +% git branch -m trunk master
    +    
    +
  14. +
  15. Clean up branches and tags +
    +% cd ~/new-bare.git
    +% git for-each-ref --format='%(refname)' refs/heads/tags |
    +cut -d / -f 4 |
    +while read ref
    +do
    +  git tag "$ref" "refs/heads/tags/$ref";
    +  git branch -D "tags/$ref";
    +done
    +    
    +
  16. +
  17. Copy Git repo from ~/new-bare.git to remote repository +
    +% git remote rm origin
    +% git remote add origin  https://gitbox.apache.org/repos/asf/db-jdo.git
    +% git push --all
    +% git push --tags
    +  
  18. +
+ +
+