{"thread":{"id":"13959","subject":"[PATCH] Add SVN->Git conversion example to documentation","startedAt":"2008-06-14T21:58:12Z","lastAt":"2008-06-18T00:55:55Z","messageCount":4,"participants":["Heikki Orsila","Miklos Vajna","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"79886","messageId":"20080614215812.GA28574@zakalwe.fi","threadId":"13959","inReplyTo":null,"subject":"[PATCH] Add SVN->Git conversion example to documentation","fromName":"Heikki Orsila","fromEmail":"heikki.orsila@iki.fi","sentAt":"2008-06-14T21:58:12Z","receivedAt":"2008-06-14T21:58:12Z","isPatch":true,"sender":{"key":"heikki.orsila@iki.fi","avatar":null},"body":"Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>\n---\nThis is the third round. Added some commands to clean up the repository, \nand set fetch heads. Thanks to Miklos Vajna for feedback.\n\n Documentation/git-svn.txt |   41 ++++++++++++++++++++++++++++++++++++++---\n 1 files changed, 38 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex f4cbd2f..26e00c5 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -11,9 +11,12 @@ SYNOPSIS\n \n DESCRIPTION\n -----------\n-git-svn is a simple conduit for changesets between Subversion and git.\n-It is not to be confused with linkgit:git-svnimport[1], which is\n-read-only.\n+git-svn is a simple bidirectional conduit for changesets between\n+Subversion and git. It is used to develop projects with Git tools,\n+but commit changes to a Subversion repository. It can also be used to\n+convert a Subversion repository to a Git repository. It should not\n+be confused with linkgit:git-svnimport[1], which does Subversion to\n+Git conversion, but not the other direction.\n \n git-svn was originally designed for an individual developer who wants a\n bidirectional flow of changesets between a single branch in Subversion\n@@ -520,6 +523,38 @@ have each person clone that repository with 'git clone':\n \tgit-svn rebase\n ------------------------------------------------------------------------\n \n+CONVERTING A SUBVERSION REPOSITORY TO A GIT REPOSITORY\n+------------------------------------------------------\n+\n+When converting a Subversion repository to a Git repository\n+--no-metadata removes \"git-svn-id:\" comments from the log.\n+-A option is used to convert SVN pseudonyms to real names\n+and email addresses. The whole repository, or a part of it can be\n+converted. Two examples below show how to convert the whole repo\n+with all branches, or only the SVN trunk.\n+\n+------------------------------------------------------------------------\n+# Convert all branches of an SVN repository to a Git repository:\n+\n+\tgit svn clone --no-metadata -A authors.txt SVN_URL foo.git\n+\n+# Convert only the trunk of an SVN repository to a Git repository:\n+\n+\tgit svn clone --no-metadata -A authors.txt SVN_URL/trunk foo.git\n+------------------------------------------------------------------------\n+After that, the new repository should be cleaned, and fetch heads should\n+be set.\n+------------------------------------------------------------------------\n+\tcd foo.git/.git\n+\trm -rf svn\n+\tgit config --remove-section svn-remote.svn\n+\tgit config remote.origin.url .\n+\tgit config remote.origin.fetch +refs/remotes/tags/*:refs/tags/*\n+\tgit config --add remote.origin.fetch +refs/remotes/*:refs/heads/*\n+\tgit fetch\n+\tgit gc\n+------------------------------------------------------------------------\n+\n REBASE VS. PULL/MERGE\n ---------------------\n \n-- \n1.5.5.1.1.ga5e5c\n"},{"id":"79889","messageId":"20080614224758.GL29404@genesis.frugalware.org","threadId":"13959","inReplyTo":"20080614215812.GA28574@zakalwe.fi","subject":"Re: [PATCH] Add SVN->Git conversion example to documentation","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-06-14T22:47:58Z","receivedAt":"2008-06-14T22:47:58Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sun, Jun 15, 2008 at 12:58:12AM +0300, Heikki Orsila <heikki.orsila@iki.fi> wrote:\n> +After that, the new repository should be cleaned, and fetch heads should\n> +be set.\n> +------------------------------------------------------------------------\n> +\tcd foo.git/.git\n\nHeh, I was confused. foo.git is usually a bare repo, if the repo has a\nworking directory as well, then just call it foo.\n\nAnd then: if you convert an svn repo to a git one, don't you want to\nconvert it to a bare repo?\n\nI haven't tried git-svn clone but the following will work for sure:\n\ngit --bare init\ngit --bare svn init -s URL\ngit --bare svn fetch\n\n> +\trm -rf svn\n> +\tgit config --remove-section svn-remote.svn\n> +\tgit config remote.origin.url .\n> +\tgit config remote.origin.fetch +refs/remotes/tags/*:refs/tags/*\n> +\tgit config --add remote.origin.fetch +refs/remotes/*:refs/heads/*\n> +\tgit fetch\n> +\tgit gc\n\nIf you remove the svn dir, why don't you remove refs/remotes as well?\n(Probably via update-ref since git svn will pack refs before it ends for\nbig repos, I think.)\n\nAlso I think it would be a good idea to give a hint how to do\nincremental updates. Something like not deleting the svn dir and using\ngit --bare svn fetch; git fetch.\n\nPS: I'm not a git-svn contributor or anything, just thought I give you\nsome advices, I hope it helped. :-)\n"},{"id":"80182","messageId":"7viqw74phb.fsf@gitster.siamese.dyndns.org","threadId":"13959","inReplyTo":"20080614215812.GA28574@zakalwe.fi","subject":"Re: [PATCH] Add SVN->Git conversion example to documentation","fromName":"Junio C Hamano","fromEmail":"junio@pobox.com","sentAt":"2008-06-17T23:21:36Z","receivedAt":"2008-06-17T23:21:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Heikki Orsila <heikki.orsila@iki.fi> writes:\n\n> Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>\n> ---\n> This is the third round. Added some commands to clean up the repository, \n> and set fetch heads. Thanks to Miklos Vajna for feedback.\n>\n>  Documentation/git-svn.txt |   41 ++++++++++++++++++++++++++++++++++++++---\n>  1 files changed, 38 insertions(+), 3 deletions(-)\n>\n> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\n> index f4cbd2f..26e00c5 100644\n> --- a/Documentation/git-svn.txt\n> +++ b/Documentation/git-svn.txt\n> @@ -11,9 +11,12 @@ SYNOPSIS\n>  \n>  DESCRIPTION\n>  -----------\n> -git-svn is a simple conduit for changesets between Subversion and git.\n> -It is not to be confused with linkgit:git-svnimport[1], which is\n> -read-only.\n> +git-svn is a simple bidirectional conduit for changesets between\n> +Subversion and git. It is used to develop projects with Git tools,\n> +but commit changes to a Subversion repository. It can also be used to\n\nThat is correct but doesn't the above give a false impression that commits\nare only made on subversion side and never on git side?\n\n> +convert a Subversion repository to a Git repository. It should not\n> +be confused with linkgit:git-svnimport[1], which does Subversion to\n> +Git conversion, but not the other direction.\n\nWe do not ship nor document svnimport anymore and linkgit: there is\nactively wrong.  People seem to be confused with ancient documents still\nfloating on the Web that talk about svnimport, and I think it is a good\nidea to try to clear the confusion here, but perhaps...\n\n\t... with the deprecated `git-svnimport`, which was used for\n\tone-way conversion from Subversion to git.\n\n> @@ -520,6 +523,38 @@ have each person clone that repository with 'git clone':\n>  \tgit-svn rebase\n>  ------------------------------------------------------------------------\n>  \n> +CONVERTING A SUBVERSION REPOSITORY TO A GIT REPOSITORY\n> +------------------------------------------------------\n> +\n> +When converting a Subversion repository to a Git repository\n> +--no-metadata removes \"git-svn-id:\" comments from the log.\n> +-A option is used to convert SVN pseudonyms to real names\n\nAnything that user usually would type on the command line it is preferred\nto typeset with `quoted like this`, so \"`--no-metadata`\" and \"`-A` option\".\n\nIt is not `--no-metadata` \"removes\".  git-svn adds cruft because it wants\nto use it for bidi operation, but --no-metadata prevents it from doing\nso.\n"},{"id":"80190","messageId":"20080618005555.GB5930@jolt.modeemi.cs.tut.fi","threadId":"13959","inReplyTo":"7viqw74phb.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add SVN->Git conversion example to documentation","fromName":"Heikki Orsila","fromEmail":"shd@modeemi.fi","sentAt":"2008-06-18T00:55:55Z","receivedAt":"2008-06-18T00:55:55Z","isPatch":true,"sender":{"key":"shd@modeemi.fi","avatar":null},"body":"On Tue, Jun 17, 2008 at 04:21:36PM -0700, Junio C Hamano wrote:\n> > -git-svn is a simple conduit for changesets between Subversion and git.\n> > -It is not to be confused with linkgit:git-svnimport[1], which is\n> > -read-only.\n> > +git-svn is a simple bidirectional conduit for changesets between\n> > +Subversion and git. It is used to develop projects with Git tools,\n> > +but commit changes to a Subversion repository. It can also be used to\n> \n> That is correct but doesn't the above give a false impression that commits\n> are only made on subversion side and never on git side?\n\nHmm.. I'll try to make it more explicity. Will send another patch soon.\n\n> > +convert a Subversion repository to a Git repository. It should not\n> > +be confused with linkgit:git-svnimport[1], which does Subversion to\n> > +Git conversion, but not the other direction.\n> \n> We do not ship nor document svnimport anymore and linkgit: there is\n> actively wrong.  People seem to be confused with ancient documents still\n> floating on the Web that talk about svnimport, and I think it is a good\n> idea to try to clear the confusion here, but perhaps...\n\nOK, I will not mention svnimport in the next patch.\n\n> \t... with the deprecated `git-svnimport`, which was used for\n> \tone-way conversion from Subversion to git.\n> \n> > @@ -520,6 +523,38 @@ have each person clone that repository with 'git clone':\n> >  \tgit-svn rebase\n> >  ------------------------------------------------------------------------\n> >  \n> > +CONVERTING A SUBVERSION REPOSITORY TO A GIT REPOSITORY\n> > +------------------------------------------------------\n> > +\n> > +When converting a Subversion repository to a Git repository\n> > +--no-metadata removes \"git-svn-id:\" comments from the log.\n> > +-A option is used to convert SVN pseudonyms to real names\n> \n> Anything that user usually would type on the command line it is preferred\n> to typeset with `quoted like this`, so \"`--no-metadata`\" and \"`-A` option\".\n> \n> It is not `--no-metadata` \"removes\".  git-svn adds cruft because it wants\n> to use it for bidi operation, but --no-metadata prevents it from doing\n> so.\n\nOK\n\n-- \nHeikki Orsila\nheikki.orsila@iki.fi\nhttp://www.iki.fi/shd\n"}]}