git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Re: Can I switch a git-svn clone from a file => http url?
  2008-04-02 14:38 Can I switch a git-svn clone from a file => http url? Stephen Bannasch
@ 2008-04-02 13:47 ` Johannes Schindelin
  2008-04-02 15:17 ` Björn Steinbrink
  2008-04-03  6:05 ` Teemu Likonen
  2 siblings, 0 replies; 7+ messages in thread
From: Johannes Schindelin @ 2008-04-02 13:47 UTC (permalink / raw)
  To: Stephen Bannasch; +Cc: git

Hi,

On Wed, 2 Apr 2008, Stephen Bannasch wrote:

> 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

Have you tried to edit the .git/config?  The key to look for is 
svn-remote.svn.url.

Hth,
Dscho

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Can I switch a git-svn clone from a file => http url?
@ 2008-04-02 14:38 Stephen Bannasch
  2008-04-02 13:47 ` Johannes Schindelin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Stephen Bannasch @ 2008-04-02 14:38 UTC (permalink / raw)
  To: git

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can I switch a git-svn clone from a file => http url?
  2008-04-02 14:38 Can I switch a git-svn clone from a file => http url? Stephen Bannasch
  2008-04-02 13:47 ` Johannes Schindelin
@ 2008-04-02 15:17 ` Björn Steinbrink
  2008-04-03  2:06   ` Stephen Bannasch
  2008-04-03  6:05 ` Teemu Likonen
  2 siblings, 1 reply; 7+ messages in thread
From: Björn Steinbrink @ 2008-04-02 15:17 UTC (permalink / raw)
  To: Stephen Bannasch; +Cc: git

On 2008.04.02 10:38:34 -0400, Stephen Bannasch wrote:
> 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.

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 the
rewriteRoot entry there.

> 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

Basically, 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can I switch a git-svn clone from a file => http url?
  2008-04-02 15:17 ` Björn Steinbrink
@ 2008-04-03  2:06   ` Stephen Bannasch
  2008-04-05  0:23     ` Björn Steinbrink
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Bannasch @ 2008-04-03  2:06 UTC (permalink / raw)
  To: git

Thanks Björn,

At 5:17 PM +0200 4/2/08, Björn Steinbrink wrote:
>On 2008.04.02 10:38:34 -0400, Stephen Bannasch wrote:
> > 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
>
>Basically, this should work:
>
>Change the URL to the repo in your .git/config.

Done

>Use filter-branch to change all git-svn-id lines in the log entries.

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

Do you mean each one should just be re-written to a new SHA1 keys? If so how should I generate new SHA1 keys?

>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
>--
>To unsubscribe from this list: send the line "unsubscribe git" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can I switch a git-svn clone from a file => http url?
  2008-04-02 14:38 Can I switch a git-svn clone from a file => http url? Stephen Bannasch
  2008-04-02 13:47 ` Johannes Schindelin
  2008-04-02 15:17 ` Björn Steinbrink
@ 2008-04-03  6:05 ` Teemu Likonen
  2008-04-04  0:49   ` Stephen Bannasch
  2 siblings, 1 reply; 7+ messages in thread
From: Teemu Likonen @ 2008-04-03  6:05 UTC (permalink / raw)
  To: git; +Cc: Stephen Bannasch

Stephen Bannasch kirjoitti:

> 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.

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 fetch

This 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://...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can I switch a git-svn clone from a file => http url?
  2008-04-03  6:05 ` Teemu Likonen
@ 2008-04-04  0:49   ` Stephen Bannasch
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Bannasch @ 2008-04-04  0:49 UTC (permalink / raw)
  To: Teemu Likonen, git

At 9:05 AM +0300 4/3/08, Teemu Likonen wrote:
>Stephen Bannasch kirjoitti:
>
>> 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.
>
>2. Convert your repo again:
>
>$ mkdir repo ; cd repo
>$ git svn init --rewrite-root=http://... file:///...
>$ git svn fetch
>
>This 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

to:

> >Use filter-branch to change all git-svn-id lines in the log entries.

But it wasn't clear to me how to change the git-svn-id lines.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can I switch a git-svn clone from a file => http url?
  2008-04-03  2:06   ` Stephen Bannasch
@ 2008-04-05  0:23     ` Björn Steinbrink
  0 siblings, 0 replies; 7+ messages in thread
From: Björn Steinbrink @ 2008-04-05  0:23 UTC (permalink / raw)
  To: Stephen Bannasch; +Cc: git

[missed the message because you dropped me from Cc:...]

On 2008.04.02 22:06:48 -0400, Stephen Bannasch wrote:
> Thanks Björn,
> 
> At 5:17 PM +0200 4/2/08, Björn Steinbrink wrote:
> >On 2008.04.02 10:38:34 -0400, Stephen Bannasch wrote:
> > > 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
> >
> >Basically, this should work:
> >
> >Change the URL to the repo in your .git/config.
> 
> Done
> 
> >Use filter-branch to change all git-svn-id lines in the log entries.
> 
> 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

Ouch, that replaced your commit messages with the sha1 hashes... Should
have been something like:
git filter-branch --msg-filter 'sed "s,file:///....,http:///,"' -- --all

Björn

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-04-05  0:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-02 14:38 Can I switch a git-svn clone from a file => http url? Stephen Bannasch
2008-04-02 13:47 ` Johannes Schindelin
2008-04-02 15:17 ` Björn Steinbrink
2008-04-03  2:06   ` Stephen Bannasch
2008-04-05  0:23     ` Björn Steinbrink
2008-04-03  6:05 ` Teemu Likonen
2008-04-04  0:49   ` Stephen Bannasch

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).