{"thread":{"id":"12965","subject":"Can I switch a git-svn clone from a file => http url?","startedAt":"2008-04-02T13:47:48Z","lastAt":"2008-04-05T00:23:10Z","messageCount":7,"participants":["Stephen Bannasch","Johannes Schindelin","Björn Steinbrink","Teemu Likonen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"73546","messageId":"alpine.LSU.1.00.0804021546460.4008@racer.site","threadId":"12965","inReplyTo":"p06240804c41942f6276e@[192.168.1.114]","subject":"Re: Can I switch a git-svn clone from a file => http url?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-04-02T13:47:48Z","receivedAt":"2008-04-02T13:47:48Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 2 Apr 2008, Stephen Bannasch wrote:\n\n> Is there an operation I can now do to switch the base url from:\n> \n>   file:///Path/to/svn/repository/projects\n> \n> to\n> \n>   https://svn.concord.org/svn/projects\n\nHave you tried to edit the .git/config?  The key to look for is \nsvn-remote.svn.url.\n\nHth,\nDscho\n"},{"id":"73545","messageId":"p06240804c41942f6276e@[192.168.1.114]","threadId":"12965","inReplyTo":null,"subject":"Can I switch a git-svn clone from a file => http url?","fromName":"Stephen Bannasch","fromEmail":"stephen.bannasch@deanbrook.org","sentAt":"2008-04-02T14:38:34Z","receivedAt":"2008-04-02T14:38:34Z","isPatch":false,"sender":{"key":"stephen.bannasch@deanbrook.org","avatar":null},"body":"I've just created a git-svn clone from a svn repo accessed locally \nwith a file:/// path.\n\nUnfortunately the local svn repo is just a copy of the main svn repo \nnormally accessed with http or https (served through Apache). I was \nhaving problems cloning the main svn repository (more details below) \nso I archived the remote svn repository and copied it to my local \nhard drive.\n\nIs there an operation I can now do to switch the base url from:\n\n   file:///Path/to/svn/repository/projects\n\nto\n\n   https://svn.concord.org/svn/projects\n\nHere's more details about the problem that got me to this spot:\n\nThe svn repo is about 1GB.\n\nI tried several times on a 1000baseT network to git-svn clone the \nrepo. There are about 13000 revisions but the clone process would \nrandomly stop without an error somewhere between revision 400 and \n1200.\n\nThis was the command I was using:\n\ngit svn clone https://svn.concord.org/svn/projects\n\nI'm running git version 1.5.4.4 (installed via ports) on MacOS 10.5.2.\n"},{"id":"73547","messageId":"20080402151721.GA31738@atjola.homenet","threadId":"12965","inReplyTo":"p06240804c41942f6276e@[192.168.1.114]","subject":"Re: Can I switch a git-svn clone from a file => http url?","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-04-02T15:17:21Z","receivedAt":"2008-04-02T15:17:21Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2008.04.02 10:38:34 -0400, Stephen Bannasch wrote:\n> I've just created a git-svn clone from a svn repo accessed locally with a \n> file:/// path.\n>\n> Unfortunately the local svn repo is just a copy of the main svn repo  \n> normally accessed with http or https (served through Apache). I was  \n> having problems cloning the main svn repository (more details below) so I \n> archived the remote svn repository and copied it to my local hard drive.\n\nI guess you should have used the --rewrite-root option when you did the\nclone. Then the metadata in the log entries would already point to the\nright URL and you could just adjust the URL in .git/config and drop the\nrewriteRoot entry there.\n\n> Is there an operation I can now do to switch the base url from:\n>\n>   file:///Path/to/svn/repository/projects\n>\n> to\n>\n>   https://svn.concord.org/svn/projects\n\nBasically, this should work:\n\nChange the URL to the repo in your .git/config.\nUse filter-branch to change all git-svn-id lines in the log entries.\nDelete the .rev_map.* files in .git/svn/*\nRun git svn fetch (rebuilds the .rev_map.* files).\n\nThe filter-branch call should use the --msg-filter option to change the\nlog entries and should apply to all the svn branches/tags/trunk (or just\nuse \" -- --all\", if there's nothing that may not be filtered).\n\nHTH\nBjörn\n"},{"id":"73572","messageId":"p06240802c419e22d78a7@[63.138.152.125]","threadId":"12965","inReplyTo":"20080402151721.GA31738@atjola.homenet","subject":"Re: Can I switch a git-svn clone from a file => http url?","fromName":"Stephen Bannasch","fromEmail":"stephen.bannasch@deanbrook.org","sentAt":"2008-04-03T02:06:48Z","receivedAt":"2008-04-03T02:06:48Z","isPatch":false,"sender":{"key":"stephen.bannasch@deanbrook.org","avatar":null},"body":"Thanks Björn,\n\nAt 5:17 PM +0200 4/2/08, Björn Steinbrink wrote:\n>On 2008.04.02 10:38:34 -0400, Stephen Bannasch wrote:\n> > Is there an operation I can now do to switch the base url from:\n>>\n>>   file:///Path/to/svn/repository/projects\n>>\n>> to\n>>\n>>   https://svn.concord.org/svn/projects\n>\n>Basically, this should work:\n>\n>Change the URL to the repo in your .git/config.\n\nDone\n\n>Use filter-branch to change all git-svn-id lines in the log entries.\n\nI've just started using git so please forgive the beginner questions.\n\nWhat should I change the log entries to?\n\nHere's what the log entries look like now:\n\n$ git-filter-branch --msg-filter 'echo $GIT_COMMIT'\n^MRewrite 89817efa5b290d375786a5af9a0dcc338df8a68c (1/13099)^MRewrite b090d1d40cba2c66a494d52e370317487d103484 (2/13099)^M\n\nDo you mean each one should just be re-written to a new SHA1 keys? If so how should I generate new SHA1 keys?\n\n>The filter-branch call should use the --msg-filter option to change the\n>log entries and should apply to all the svn branches/tags/trunk (or just\n>use \" -- --all\", if there's nothing that may not be filtered).\n>\n>HTH\n>Björn\n>--\n>To unsubscribe from this list: send the line \"unsubscribe git\" in\n>the body of a message to majordomo@vger.kernel.org\n>More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"73577","messageId":"200804030905.46425.tlikonen@iki.fi","threadId":"12965","inReplyTo":"p06240804c41942f6276e@[192.168.1.114]","subject":"Re: Can I switch a git-svn clone from a file => http url?","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2008-04-03T06:05:46Z","receivedAt":"2008-04-03T06:05:46Z","isPatch":false,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"Stephen Bannasch kirjoitti:\n\n> I've just created a git-svn clone from a svn repo accessed locally\n> with a file:/// path.\n>\n> Unfortunately the local svn repo is just a copy of the main svn repo\n> normally accessed with http or https (served through Apache). I was\n> having problems cloning the main svn repository (more details below)\n> so I archived the remote svn repository and copied it to my local\n> hard drive.\n\nI know two options:\n\n1. Keep your current Git repo but set the url and rewriteroot options \nin .git/config:\n\n[svn-remote \"svn\"]\n\turl = http://...\n\trewriteroot = file:///...\n\nYour commit messages will still have git-svn-id pointing at file:///... \nurl but it should work fine.\n\n\n2. Convert your repo again:\n\n$ mkdir repo ; cd repo\n$ git svn init --rewrite-root=http://... file:///...\n$ git svn fetch\n\nThis way you'll create new Git repo from file:///... url but commit \nmessages will have git-svn-id's url pointing at http://... . After that \nset the correct remote url to .git/config:\n\n[svn-remote \"svn\"]\n\turl = http://...\n"},{"id":"73638","messageId":"p06240804c41b28150d6a@[63.138.152.125]","threadId":"12965","inReplyTo":"200804030905.46425.tlikonen@iki.fi","subject":"Re: Can I switch a git-svn clone from a file => http url?","fromName":"Stephen Bannasch","fromEmail":"stephen.bannasch@deanbrook.org","sentAt":"2008-04-04T00:49:54Z","receivedAt":"2008-04-04T00:49:54Z","isPatch":false,"sender":{"key":"stephen.bannasch@deanbrook.org","avatar":null},"body":"At 9:05 AM +0300 4/3/08, Teemu Likonen wrote:\n>Stephen Bannasch kirjoitti:\n>\n>> I've just created a git-svn clone from a svn repo accessed locally\n>> with a file:/// path.\n>>\n>> Unfortunately the local svn repo is just a copy of the main svn repo\n>> normally accessed with http or https (served through Apache). I was\n>> having problems cloning the main svn repository (more details below)\n>> so I archived the remote svn repository and copied it to my local\n> > hard drive.\n>\n>2. Convert your repo again:\n>\n>$ mkdir repo ; cd repo\n>$ git svn init --rewrite-root=http://... file:///...\n>$ git svn fetch\n>\n>This way you'll create new Git repo from file:///... url but commit\n>messages will have git-svn-id's url pointing at http://... . After that\n>set the correct remote url to .git/config:\n>\n>[svn-remote \"svn\"]\n>\turl = http://...\n\nThanks Teemu,\n\nThat took a while but worked.\n\nI also removed the rewriteRoot line from config after editing the url.\n\nI think I might have achieved the same effect more quickly with Björn's suggestion to use:\n\n  git-filter-branch --msg-filter\n\nto:\n\n> >Use filter-branch to change all git-svn-id lines in the log entries.\n\nBut it wasn't clear to me how to change the git-svn-id lines.\n"},{"id":"73678","messageId":"20080405002310.GB3101@atjola.homenet","threadId":"12965","inReplyTo":"p06240802c419e22d78a7@[63.138.152.125]","subject":"Re: Can I switch a git-svn clone from a file => http url?","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-04-05T00:23:10Z","receivedAt":"2008-04-05T00:23:10Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"[missed the message because you dropped me from Cc:...]\n\nOn 2008.04.02 22:06:48 -0400, Stephen Bannasch wrote:\n> Thanks Björn,\n> \n> At 5:17 PM +0200 4/2/08, Björn Steinbrink wrote:\n> >On 2008.04.02 10:38:34 -0400, Stephen Bannasch wrote:\n> > > Is there an operation I can now do to switch the base url from:\n> >>\n> >>   file:///Path/to/svn/repository/projects\n> >>\n> >> to\n> >>\n> >>   https://svn.concord.org/svn/projects\n> >\n> >Basically, this should work:\n> >\n> >Change the URL to the repo in your .git/config.\n> \n> Done\n> \n> >Use filter-branch to change all git-svn-id lines in the log entries.\n> \n> I've just started using git so please forgive the beginner questions.\n> \n> What should I change the log entries to?\n> \n> Here's what the log entries look like now:\n> \n> $ git-filter-branch --msg-filter 'echo $GIT_COMMIT'\n> ^MRewrite 89817efa5b290d375786a5af9a0dcc338df8a68c (1/13099)^MRewrite b090d1d40cba2c66a494d52e370317487d103484 (2/13099)^M\n\nOuch, that replaced your commit messages with the sha1 hashes... Should\nhave been something like:\ngit filter-branch --msg-filter 'sed \"s,file:///....,http:///,\"' -- --all\n\nBjörn\n"}]}