git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git svn relocate [SCRIPT]
@ 2010-06-22  9:40 Christian Stimming
  2010-06-22 13:15 ` Jakub Narebski
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Stimming @ 2010-06-22  9:40 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 908 bytes --]

Dear all,

I haven't found an easy solution for when a git-svn SVN server changes  
its address, but I think the attached patch implements a solution  
useful for others as well.

In plain svn this is the "svn switch --relocate URL1 URL2" command to  
change the URL of a working copy from URL1 to URL2. In git-svn, there  
didn't seem to be a suitable command available. What I found were the  
instructions here  
http://translate.org.za/blogs/wynand/en/content/changing-your-svn-repository-address-git-svn-setup and some other google hits related to this one. The instructions from the wynand blog uses git-filter-branch, and the instructions were complete enough so that an all-in-one shell script wasn't too difficult to write. So the attached script implements this: Just call "git-svn-relocate URL1 URL2" and all the rest should happen  
automatically.

Hope this helps.

Regards,

Christian Stimming

[-- Attachment #2: git-svn-relocate.sh --]
[-- Type: application/x-sh, Size: 1971 bytes --]

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

* Re: git svn relocate [SCRIPT]
  2010-06-22  9:40 git svn relocate [SCRIPT] Christian Stimming
@ 2010-06-22 13:15 ` Jakub Narebski
  2010-06-22 15:11   ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Narebski @ 2010-06-22 13:15 UTC (permalink / raw)
  To: Christian Stimming; +Cc: git

Christian Stimming <christian@cstimming.de> writes:

> Dear all,
> 
> I haven't found an easy solution for when a git-svn SVN server changes
> its address, but I think the attached patch implements a solution
> useful for others as well.
> 
> In plain svn this is the "svn switch --relocate URL1 URL2" command to
> change the URL of a working copy from URL1 to URL2. In git-svn, there
> didn't seem to be a suitable command available. What I found were the
> instructions here
> http://translate.org.za/blogs/wynand/en/content/changing-your-svn-repository-address-git-svn-setup
> and some other google hits related to this one. The instructions from
> the wynand blog uses git-filter-branch, and the instructions were
> complete enough so that an all-in-one shell script wasn't too
> difficult to write. So the attached script implements this: Just call
> "git-svn-relocate URL1 URL2" and all the rest should happen
> automatically.

If you can put this script somewhere (e.g. GitHub, or repo.or.cz), could you
please add information about it to InterfacesFriontendsAndTools page on Git
Wiki (http://git.wiki.kernel.org)?

Alternatively, perhaps you could send it as a patch adding it to somwehere
in the contrib/

-- 
Jakub Narebski
Poland
ShadeHawk on #git

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

* Re: git svn relocate [SCRIPT]
  2010-06-22 13:15 ` Jakub Narebski
@ 2010-06-22 15:11   ` Ævar Arnfjörð Bjarmason
  2010-06-23  9:53     ` Eric Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-06-22 15:11 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Christian Stimming, git, Eric Wong

On Tue, Jun 22, 2010 at 13:15, Jakub Narebski <jnareb@gmail.com> wrote:
> If you can put this script somewhere (e.g. GitHub, or repo.or.cz), could you
> please add information about it to InterfacesFriontendsAndTools page on Git
> Wiki (http://git.wiki.kernel.org)?
>
> Alternatively, perhaps you could send it as a patch adding it to somwehere
> in the contrib/

This is part of the "Reconstructing git-svn metadata after a git
clone"[1] problem for which there's an open thread. You have to
rewrite history using git-filter-branch to fix the branch references
if you need to change the SVN URL.

It would be nice if you could specify that sed replacement in some
git-svn config file if you needed to change e.g. someone's http://
clone to a svn+ssh:// clone without rewriting the whole thing.

Would that sort of thing be possible? Eric?

http://kerneltrap.org/mailarchive/git/2010/5/8/30062

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

* Re: git svn relocate [SCRIPT]
  2010-06-22 15:11   ` Ævar Arnfjörð Bjarmason
@ 2010-06-23  9:53     ` Eric Wong
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2010-06-23  9:53 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Jakub Narebski, Christian Stimming, git

Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> On Tue, Jun 22, 2010 at 13:15, Jakub Narebski <jnareb@gmail.com> wrote:
> > If you can put this script somewhere (e.g. GitHub, or repo.or.cz), could you
> > please add information about it to InterfacesFriontendsAndTools page on Git
> > Wiki (http://git.wiki.kernel.org)?
> >
> > Alternatively, perhaps you could send it as a patch adding it to somwehere
> > in the contrib/
> 
> This is part of the "Reconstructing git-svn metadata after a git
> clone"[1] problem for which there's an open thread. You have to
> rewrite history using git-filter-branch to fix the branch references
> if you need to change the SVN URL.
> 
> It would be nice if you could specify that sed replacement in some
> git-svn config file if you needed to change e.g. someone's http://
> clone to a svn+ssh:// clone without rewriting the whole thing.
> 
> Would that sort of thing be possible? Eric?
> 
> http://kerneltrap.org/mailarchive/git/2010/5/8/30062

Does the existing rewriteRoot configuration option work for this?
(I had almost forgotten about it myself :x)

-- 
Eric Wong

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

end of thread, other threads:[~2010-06-23  9:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-22  9:40 git svn relocate [SCRIPT] Christian Stimming
2010-06-22 13:15 ` Jakub Narebski
2010-06-22 15:11   ` Ævar Arnfjörð Bjarmason
2010-06-23  9:53     ` Eric Wong

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 NNTP newsgroup(s).