I've just created a git-svn clone from a svn repo accessed locally
with a file:/// path.Unfortunately the local svn repo is just a copy of the main svn repo
normally accessed with http or https (served through Apache). I was
having problems cloning the main svn repository (more details below)
so I archived the remote svn repository and copied it to my local
hard drive.Is there an operation I can now do to switch the base url from:
file:///Path/to/svn/repository/projects
to
https://svn.concord.org/svn/projects
Here's more details about the problem that got me to this spot:
The svn repo is about 1GB.
I tried several times on a 1000baseT network to git-svn clone the
repo. There are about 13000 revisions but the clone process would
randomly stop without an error somewhere between revision 400 and
1200.This was the command I was using:
git svn clone https://svn.concord.org/svn/projects
I'm running git version 1.5.4.4 (installed via ports) on MacOS 10.5.2.
--
I know two options:
1. Keep your current Git repo but set the url and rewriteroot options
in .git/config:[svn-remote "svn"]
url = http://...
rewriteroot = file:///...Your commit messages will still have git-svn-id pointing at file:///...
url but it should work fine.2. Convert your repo again:
$ mkdir repo ; cd repo
$ git svn init --rewrite-root=http://... file:///...
$ git svn fetchThis way you'll create new Git repo from file:///... url but commit
messages will have git-svn-id's url pointing at http://... . After that
set the correct remote url to .git/config:[svn-remote "svn"]
url = http://...
--
Thanks Teemu,
That took a while but worked.
I also removed the rewriteRoot line from config after editing the url.
I think I might have achieved the same effect more quickly with Björn's suggestion to use:
git-filter-branch --msg-filter
But it wasn't clear to me how to change the git-svn-id lines.
--
I guess you should have used the --rewrite-root option when you did the
clone. Then the metadata in the log entries would already point to the
right URL and you could just adjust the URL in .git/config and drop theBasically, this should work:
Change the URL to the repo in your .git/config.
Use filter-branch to change all git-svn-id lines in the log entries.
Delete the .rev_map.* files in .git/svn/*
Run git svn fetch (rebuilds the .rev_map.* files).The filter-branch call should use the --msg-filter option to change the
log entries and should apply to all the svn branches/tags/trunk (or just
use " -- --all", if there's nothing that may not be filtered).HTH
Björn
--
Thanks Björn,
I've just started using git so please forgive the beginner questions.
What should I change the log entries to?
Here's what the log entries look like now:
$ git-filter-branch --msg-filter 'echo $GIT_COMMIT'
^MRewrite 89817efa5b290d375786a5af9a0dcc338df8a68c (1/13099)^MRewrite b090d1d40cba2c66a494d52e370317487d103484 (2/13099)^M--
[missed the message because you dropped me from Cc:...]
Ouch, that replaced your commit messages with the sha1 hashes... Should
have been something like:
git filter-branch --msg-filter 'sed "s,file:///....,http:///,"' -- --allBjörn
--
Hi,
Have you tried to edit the .git/config? The key to look for is
svn-remote.svn.url.Hth,
Dscho
--
| Eric Paris | [RFC 0/5] [TALPA] Intro to a linux interface for on access scanning |
| Mark Fasheh | Re: -mm merge plans for 2.6.23 -- sys_fallocate |
| Linus Torvalds | Linux 2.6.21-rc4 |
| Linus Torvalds | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
git: | |
| David Miller | [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Christoph Lameter | Network latency regressions from 2.6.22 to 2.6.29 |
