* git-svn branch naming question
@ 2007-12-08 1:04 Miklos Vajna
2007-12-08 10:59 ` Peter Baumann
0 siblings, 1 reply; 13+ messages in thread
From: Miklos Vajna @ 2007-12-08 1:04 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 852 bytes --]
hi,
i'm using git-svn for projects where i don't just want to commit to
trunk but to other branches, too.
for example:
git-svn clone -s svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build ooo-build
then i have a local 'master' branch and all the other branches are local
branches.
so, when i want to work in the ooo-build-2-3 branch, i do a:
git checkout -b ooo-build-2-3 ooo-build-2-3
but when i do a git svn rebase, i get:
warning: refname 'ooo-build-2-3' is ambiguous.
what am i doing wrong?
in fact i suspect that in case i would use some other branch name, like
simply '2-3' then i could get rid of this warning, but that's the
problem with using the equivalent name of the remote branch when working
in a branch locally?
probably i miss some parameter to git-svn clone so that it would prefix
the refs with some 'origin'?
thanks,
- VMiklos
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: git-svn branch naming question
2007-12-08 1:04 git-svn branch naming question Miklos Vajna
@ 2007-12-08 10:59 ` Peter Baumann
2007-12-08 14:14 ` Miklos Vajna
0 siblings, 1 reply; 13+ messages in thread
From: Peter Baumann @ 2007-12-08 10:59 UTC (permalink / raw)
To: Miklos Vajna; +Cc: git
On Sat, Dec 08, 2007 at 02:04:38AM +0100, Miklos Vajna wrote:
> hi,
>
> i'm using git-svn for projects where i don't just want to commit to
> trunk but to other branches, too.
>
> for example:
>
> git-svn clone -s svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build ooo-build
>
> then i have a local 'master' branch and all the other branches are local
> branches.
>
> so, when i want to work in the ooo-build-2-3 branch, i do a:
>
> git checkout -b ooo-build-2-3 ooo-build-2-3
>
> but when i do a git svn rebase, i get:
>
> warning: refname 'ooo-build-2-3' is ambiguous.
>
> what am i doing wrong?
Try using 'git svn rebase remotes/ooo-build-2-3'.
git-svn should produce its branches under refs/remotes/* and your
local branches are under refs/heads/*.
By using 'git checkout -b ooo-build-2-3 ooo-build-2-3' you created
refs/heads/ooo-build-2-3 as a copy of refs/remotes/ooo-build-2-3 and now
using only ooo-build-2-3 is ambigious. (at least in some cases where git
won't take refs/heads/ooo-build-2-3)
>
> in fact i suspect that in case i would use some other branch name, like
> simply '2-3' then i could get rid of this warning, but that's the
> problem with using the equivalent name of the remote branch when working
> in a branch locally?
>
See above.
> probably i miss some parameter to git-svn clone so that it would prefix
> the refs with some 'origin'?
Look up --prefix in the manpage for git-svn.
-Peter
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: git-svn branch naming question
2007-12-08 10:59 ` Peter Baumann
@ 2007-12-08 14:14 ` Miklos Vajna
2007-12-08 16:56 ` Peter Baumann
0 siblings, 1 reply; 13+ messages in thread
From: Miklos Vajna @ 2007-12-08 14:14 UTC (permalink / raw)
To: Peter Baumann; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 533 bytes --]
On Sat, Dec 08, 2007 at 11:59:01AM +0100, Peter Baumann <waste.manager@gmx.de> wrote:
> Look up --prefix in the manpage for git-svn.
great, --prefix is what i missed.
a related question: is it possible to avoid even the "remotes" prefix?
it could be useful when creating an incremental import of an svn repo.
(ie when using git-svn as a replacement of git-svnimport.)
so after the clone, one will see all the svn branches as a remote
branch, since they will be local (and not remote) ones in the mirror
repo.
thanks,
- VMiklos
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: git-svn branch naming question
2007-12-08 14:14 ` Miklos Vajna
@ 2007-12-08 16:56 ` Peter Baumann
2007-12-08 23:52 ` Miklos Vajna
0 siblings, 1 reply; 13+ messages in thread
From: Peter Baumann @ 2007-12-08 16:56 UTC (permalink / raw)
To: Miklos Vajna; +Cc: git
On Sat, Dec 08, 2007 at 03:14:49PM +0100, Miklos Vajna wrote:
> On Sat, Dec 08, 2007 at 11:59:01AM +0100, Peter Baumann <waste.manager@gmx.de> wrote:
> > Look up --prefix in the manpage for git-svn.
>
> great, --prefix is what i missed.
>
> a related question: is it possible to avoid even the "remotes" prefix?
>
> it could be useful when creating an incremental import of an svn repo.
> (ie when using git-svn as a replacement of git-svnimport.)
>
git svn init --stdlayout creates this entry in your .git/config per default
[svn-remote "svn"]
url = https://url/to/your/svn/repo
fetch = trunk:refs/remotes/trunk
branches = branches/*:refs/remotes/*
tags = tags/*:refs/remotes/tags/*
You could change this to
[svn-remote "svn"]
url = https://url/to/your/svn/repo
fetch = trunk:refs/remotes/origin/trunk
branches = branches/*:refs/remotes/origin/*
tags = tags/*:refs/remotes/origin/tags/*
to get what --prefix origin would do.
On the other hand you could forget completly the remote part by specifying
[svn-remote "svn"]
url = https://url/to/your/svn/repo
fetch = trunk:refs/heads/trunk
branches = branches/*:refs/heads/*
tags = tags/*:refs/heads/tags/*
but I advice you to not do this. refs/remotes has a special meaning in git,
e.g. you can't commit directly to it (which makes sense, because it only
tracks the state of the remote repo. On the other hand remote branches won't
get cloned per default.)
Side note, if you want to track only some branches, or if you have a strange
svn layout, you could use something like this:
[svn-remote "svn"]
url = https://url/to/your/svn/repo
fetch = trunk:refs/remotes/origin/trunk
fetch = branches/branchA:refs/remotes/origin/branchA
fetch = branches/branchB:refs/remotes/origin/branchB
...
-Peter
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: git-svn branch naming question
2007-12-08 16:56 ` Peter Baumann
@ 2007-12-08 23:52 ` Miklos Vajna
2007-12-09 2:05 ` Miklos Vajna
0 siblings, 1 reply; 13+ messages in thread
From: Miklos Vajna @ 2007-12-08 23:52 UTC (permalink / raw)
To: Peter Baumann; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 831 bytes --]
On Sat, Dec 08, 2007 at 05:56:57PM +0100, Peter Baumann <waste.manager@gmx.de> wrote:
> On the other hand you could forget completly the remote part by specifying
>
> [svn-remote "svn"]
> url = https://url/to/your/svn/repo
> fetch = trunk:refs/heads/trunk
> branches = branches/*:refs/heads/*
> tags = tags/*:refs/heads/tags/*
>
> but I advice you to not do this. refs/remotes has a special meaning in git,
> e.g. you can't commit directly to it (which makes sense, because it only
> tracks the state of the remote repo. On the other hand remote branches won't
> get cloned per default.)
yes, that's exactly what i want to do - in case the target is to convert
an svn repo to a git one (and i need git-svn since git-svnimport is to
be removed in 1.5.4)
thanks,
- VMiklos
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: git-svn branch naming question
2007-12-08 23:52 ` Miklos Vajna
@ 2007-12-09 2:05 ` Miklos Vajna
2007-12-09 2:13 ` Björn Steinbrink
2007-12-09 2:26 ` Eric Wong
0 siblings, 2 replies; 13+ messages in thread
From: Miklos Vajna @ 2007-12-09 2:05 UTC (permalink / raw)
To: Peter Baumann; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]
On Sun, Dec 09, 2007 at 12:52:48AM +0100, Miklos Vajna <vmiklos@frugalware.org> wrote:
> > [svn-remote "svn"]
> > url = https://url/to/your/svn/repo
> > fetch = trunk:refs/heads/trunk
> > branches = branches/*:refs/heads/*
> > tags = tags/*:refs/heads/tags/*
> >
> > but I advice you to not do this. refs/remotes has a special meaning in git,
> > e.g. you can't commit directly to it (which makes sense, because it only
> > tracks the state of the remote repo. On the other hand remote branches won't
> > get cloned per default.)
>
> yes, that's exactly what i want to do - in case the target is to convert
> an svn repo to a git one (and i need git-svn since git-svnimport is to
> be removed in 1.5.4)
hm, this seem to be not-working for me.
after "git svn init -s url" i edited the config:
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[svn-remote "svn"]
url = svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build
fetch = trunk:refs/master
branches = branches/*:refs/*
tags = tags/*:refs/tags/*
and wanted to fetch the revisions, but actually
$ git svn fetch
does not fetch any revisions. (yes, it does once i put back the
"remotes" prefix). is this a bug? :)
thanks,
- VMiklos
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: git-svn branch naming question
2007-12-09 2:05 ` Miklos Vajna
@ 2007-12-09 2:13 ` Björn Steinbrink
2007-12-09 2:25 ` Miklos Vajna
2007-12-09 2:26 ` Eric Wong
1 sibling, 1 reply; 13+ messages in thread
From: Björn Steinbrink @ 2007-12-09 2:13 UTC (permalink / raw)
To: Miklos Vajna; +Cc: Peter Baumann, git
On 2007.12.09 03:05:10 +0100, Miklos Vajna wrote:
> On Sun, Dec 09, 2007 at 12:52:48AM +0100, Miklos Vajna <vmiklos@frugalware.org> wrote:
> > > [svn-remote "svn"]
> > > url = https://url/to/your/svn/repo
> > > fetch = trunk:refs/heads/trunk
^^^^^
> > > branches = branches/*:refs/heads/*
^^^^^
> > > tags = tags/*:refs/heads/tags/*
^^^^^
> url = svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build
> fetch = trunk:refs/master
> branches = branches/*:refs/*
> tags = tags/*:refs/tags/*
Just a guess, but this seems pretty headless ;-)
Björn
> and wanted to fetch the revisions, but actually
>
> $ git svn fetch
>
> does not fetch any revisions. (yes, it does once i put back the
> "remotes" prefix). is this a bug? :)
>
> thanks,
> - VMiklos
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: git-svn branch naming question
2007-12-09 2:13 ` Björn Steinbrink
@ 2007-12-09 2:25 ` Miklos Vajna
0 siblings, 0 replies; 13+ messages in thread
From: Miklos Vajna @ 2007-12-09 2:25 UTC (permalink / raw)
To: Björn Steinbrink; +Cc: Peter Baumann, git
[-- Attachment #1: Type: text/plain, Size: 649 bytes --]
On Sun, Dec 09, 2007 at 03:13:36AM +0100, Björn Steinbrink <B.Steinbrink@gmx.de> wrote:
> > url = svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build
> > fetch = trunk:refs/master
> > branches = branches/*:refs/*
> > tags = tags/*:refs/tags/*
>
> Just a guess, but this seems pretty headless ;-)
oh, right. here is my fixed config:
[svn-remote "svn"]
url = svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build
fetch = trunk:refs/heads/master
branches = branches/*:refs/heads/*
tags = tags/*:refs/tags/*
git svn fetch still does not seem to do anything :S
thanks,
- VMiklos
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: git-svn branch naming question
2007-12-09 2:05 ` Miklos Vajna
2007-12-09 2:13 ` Björn Steinbrink
@ 2007-12-09 2:26 ` Eric Wong
2007-12-09 2:36 ` Miklos Vajna
1 sibling, 1 reply; 13+ messages in thread
From: Eric Wong @ 2007-12-09 2:26 UTC (permalink / raw)
To: Miklos Vajna; +Cc: Peter Baumann, git
Miklos Vajna <vmiklos@frugalware.org> wrote:
> On Sun, Dec 09, 2007 at 12:52:48AM +0100, Miklos Vajna <vmiklos@frugalware.org> wrote:
> > > [svn-remote "svn"]
> > > url = https://url/to/your/svn/repo
> > > fetch = trunk:refs/heads/trunk
> > > branches = branches/*:refs/heads/*
> > > tags = tags/*:refs/heads/tags/*
> > >
> > > but I advice you to not do this. refs/remotes has a special meaning in git,
> > > e.g. you can't commit directly to it (which makes sense, because it only
> > > tracks the state of the remote repo. On the other hand remote branches won't
> > > get cloned per default.)
> >
> > yes, that's exactly what i want to do - in case the target is to convert
> > an svn repo to a git one (and i need git-svn since git-svnimport is to
> > be removed in 1.5.4)
>
> hm, this seem to be not-working for me.
>
> after "git svn init -s url" i edited the config:
>
> $ cat .git/config
> [core]
> repositoryformatversion = 0
> filemode = true
> bare = false
> logallrefupdates = true
> [svn-remote "svn"]
> url = svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build
> fetch = trunk:refs/master
> branches = branches/*:refs/*
> tags = tags/*:refs/tags/*
>
> and wanted to fetch the revisions, but actually
>
> $ git svn fetch
>
> does not fetch any revisions. (yes, it does once i put back the
> "remotes" prefix). is this a bug? :)
I'm not sure if it's considered a "bug", but that's just the
way it is at the moment. I can't remember why, but I did
make git-svn force the presence of the "remotes/" prefix
in all refs it writes to...
--
Eric Wong
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: git-svn branch naming question
2007-12-09 2:26 ` Eric Wong
@ 2007-12-09 2:36 ` Miklos Vajna
2007-12-09 3:26 ` Eric Wong
0 siblings, 1 reply; 13+ messages in thread
From: Miklos Vajna @ 2007-12-09 2:36 UTC (permalink / raw)
To: Eric Wong; +Cc: Peter Baumann, git
[-- Attachment #1: Type: text/plain, Size: 649 bytes --]
On Sat, Dec 08, 2007 at 06:26:24PM -0800, Eric Wong <normalperson@yhbt.net> wrote:
> I'm not sure if it's considered a "bug", but that's just the
> way it is at the moment. I can't remember why, but I did
> make git-svn force the presence of the "remotes/" prefix
> in all refs it writes to...
okay, i see. one problem: git-svnimport is to be removed and (afaik) the
supposed way is to use git-svn instead. what is the supposed way to use
git-svn to convert an svn repo to a git one if the method i tried is not
working?
(if the branches are fetched to "remotes/" then they won't be visible
when one clones the converted repo)
thanks,
- VMiklos
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: git-svn branch naming question
2007-12-09 2:36 ` Miklos Vajna
@ 2007-12-09 3:26 ` Eric Wong
2007-12-09 5:16 ` Harvey Harrison
2007-12-09 19:36 ` Miklos Vajna
0 siblings, 2 replies; 13+ messages in thread
From: Eric Wong @ 2007-12-09 3:26 UTC (permalink / raw)
To: Miklos Vajna; +Cc: Peter Baumann, git
Miklos Vajna <vmiklos@frugalware.org> wrote:
> On Sat, Dec 08, 2007 at 06:26:24PM -0800, Eric Wong <normalperson@yhbt.net> wrote:
> > I'm not sure if it's considered a "bug", but that's just the
> > way it is at the moment. I can't remember why, but I did
> > make git-svn force the presence of the "remotes/" prefix
> > in all refs it writes to...
>
> okay, i see. one problem: git-svnimport is to be removed and (afaik) the
> supposed way is to use git-svn instead. what is the supposed way to use
> git-svn to convert an svn repo to a git one if the method i tried is not
> working?
>
> (if the branches are fetched to "remotes/" then they won't be visible
> when one clones the converted repo)
I'm pretty sure the reasoning behind "remotes/" being forced by git-svn
was to prevent users from shooting themselves in the foot, since
committing to those remote refs will break both git-svn fetch and
dcommit...
Heck, the entire "remotes/" idea started because a git-svn user made the
mistake of committing to the remote tracking branch directly:
http://thread.gmane.org/gmane.comp.version-control.git/16869/focus=16875
I'll consider accepting a patch to lift that restriction (but still use
the "remotes/" by default, of course).
Also, it's possible to fetch them after editing .git/config a little:
Harvey Harrison's "[RFC] Mirroring svn" post has a good example
on how to do it.
http://mid.gmane.org/1196922153.10408.101.camel@brick
Perhaps git-clone could gain the ability to clone refs/remotes/ as-is
without an extra step?
--
Eric Wong
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: git-svn branch naming question
2007-12-09 3:26 ` Eric Wong
@ 2007-12-09 5:16 ` Harvey Harrison
2007-12-09 19:36 ` Miklos Vajna
1 sibling, 0 replies; 13+ messages in thread
From: Harvey Harrison @ 2007-12-09 5:16 UTC (permalink / raw)
To: Eric Wong; +Cc: Miklos Vajna, Peter Baumann, git
On Sat, 2007-12-08 at 19:26 -0800, Eric Wong wrote:
>
> Perhaps git-clone could gain the ability to clone refs/remotes/ as-is
> without an extra step?
>
Something in the spirit of --mirror perhaps?
--mirror-remotes sounds about right
Harvey
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: git-svn branch naming question
2007-12-09 3:26 ` Eric Wong
2007-12-09 5:16 ` Harvey Harrison
@ 2007-12-09 19:36 ` Miklos Vajna
1 sibling, 0 replies; 13+ messages in thread
From: Miklos Vajna @ 2007-12-09 19:36 UTC (permalink / raw)
To: Eric Wong; +Cc: Peter Baumann, git
[-- Attachment #1: Type: text/plain, Size: 869 bytes --]
On Sat, Dec 08, 2007 at 07:26:08PM -0800, Eric Wong <normalperson@yhbt.net> wrote:
> Perhaps git-clone could gain the ability to clone refs/remotes/ as-is
> without an extra step?
well, what i did for now is to use 2 repos. i use git-svn to create a
regular git-svn repo from svn, then an other one to create a regular git
repo from the git-svn one. this has one benefit: git-svn requires a
working tree, but i definitely want to publish only a bare repo. so here
is what i have in the bare repo's config:
[remote "origin"]
url = /path/to/git-svn/repo
fetch = +refs/remotes/origin/tags/*:refs/tags/*
fetch = +refs/remotes/origin/trunk:refs/heads/master
fetch = +refs/remotes/origin/*:refs/heads/*
then a simple git fetch will do what i need. i'm not entirely sure this
is the right think to do, but works for me :)
thanks,
- VMiklos
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-12-09 19:36 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-08 1:04 git-svn branch naming question Miklos Vajna
2007-12-08 10:59 ` Peter Baumann
2007-12-08 14:14 ` Miklos Vajna
2007-12-08 16:56 ` Peter Baumann
2007-12-08 23:52 ` Miklos Vajna
2007-12-09 2:05 ` Miklos Vajna
2007-12-09 2:13 ` Björn Steinbrink
2007-12-09 2:25 ` Miklos Vajna
2007-12-09 2:26 ` Eric Wong
2007-12-09 2:36 ` Miklos Vajna
2007-12-09 3:26 ` Eric Wong
2007-12-09 5:16 ` Harvey Harrison
2007-12-09 19:36 ` Miklos Vajna
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).