{"thread":{"id":"11183","subject":"git-svn branch naming question","startedAt":"2007-12-08T01:04:38Z","lastAt":"2007-12-09T19:36:33Z","messageCount":13,"participants":["Miklos Vajna","Peter Baumann","Björn Steinbrink","Eric Wong","Harvey Harrison"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"62351","messageId":"20071208010438.GE3199@genesis.frugalware.org","threadId":"11183","inReplyTo":null,"subject":"git-svn branch naming question","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-12-08T01:04:38Z","receivedAt":"2007-12-08T01:04:38Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"hi,\n\ni'm using git-svn for projects where i don't just want to commit to\ntrunk but to other branches, too.\n\nfor example:\n\ngit-svn clone -s svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build ooo-build\n\nthen i have a local 'master' branch and all the other branches are local\nbranches.\n\nso, when i want to work in the ooo-build-2-3 branch, i do a:\n\ngit checkout -b ooo-build-2-3 ooo-build-2-3\n\nbut when i do a git svn rebase, i get:\n\nwarning: refname 'ooo-build-2-3' is ambiguous.\n\nwhat am i doing wrong?\n\nin fact i suspect that in case i would use some other branch name, like\nsimply '2-3' then i could get rid of this warning, but that's the\nproblem with using the equivalent name of the remote branch when working\nin a branch locally?\n\nprobably i miss some parameter to git-svn clone so that it would prefix\nthe refs with some 'origin'?\n\nthanks,\n- VMiklos\n"},{"id":"62400","messageId":"20071208105901.GA2844@xp.machine.xx","threadId":"11183","inReplyTo":"20071208010438.GE3199@genesis.frugalware.org","subject":"Re: git-svn branch naming question","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2007-12-08T10:59:01Z","receivedAt":"2007-12-08T10:59:01Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Sat, Dec 08, 2007 at 02:04:38AM +0100, Miklos Vajna wrote:\n> hi,\n> \n> i'm using git-svn for projects where i don't just want to commit to\n> trunk but to other branches, too.\n> \n> for example:\n> \n> git-svn clone -s svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build ooo-build\n> \n> then i have a local 'master' branch and all the other branches are local\n> branches.\n> \n> so, when i want to work in the ooo-build-2-3 branch, i do a:\n> \n> git checkout -b ooo-build-2-3 ooo-build-2-3\n> \n> but when i do a git svn rebase, i get:\n> \n> warning: refname 'ooo-build-2-3' is ambiguous.\n> \n> what am i doing wrong?\n\nTry using 'git svn rebase remotes/ooo-build-2-3'.\n\ngit-svn should produce its branches under refs/remotes/* and your\nlocal branches are under refs/heads/*.\n\nBy using 'git checkout -b ooo-build-2-3 ooo-build-2-3' you created\nrefs/heads/ooo-build-2-3 as a copy of refs/remotes/ooo-build-2-3 and now\nusing only ooo-build-2-3 is ambigious. (at least in some cases where git\nwon't take refs/heads/ooo-build-2-3)\n\n\n> \n> in fact i suspect that in case i would use some other branch name, like\n> simply '2-3' then i could get rid of this warning, but that's the\n> problem with using the equivalent name of the remote branch when working\n> in a branch locally?\n> \n\nSee above.\n\n> probably i miss some parameter to git-svn clone so that it would prefix\n> the refs with some 'origin'?\n\nLook up  --prefix in the manpage for git-svn.\n\n-Peter\n"},{"id":"62416","messageId":"20071208141449.GH3199@genesis.frugalware.org","threadId":"11183","inReplyTo":"20071208105901.GA2844@xp.machine.xx","subject":"Re: git-svn branch naming question","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-12-08T14:14:49Z","receivedAt":"2007-12-08T14:14:49Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sat, Dec 08, 2007 at 11:59:01AM +0100, Peter Baumann <waste.manager@gmx.de> wrote:\n> Look up  --prefix in the manpage for git-svn.\n\ngreat, --prefix is what i missed.\n\na related question: is it possible to avoid even the \"remotes\" prefix?\n\nit could be useful when creating an incremental import of an svn repo.\n(ie when using git-svn as a replacement of git-svnimport.)\n\nso after the clone, one will see all the svn branches as a remote\nbranch, since they will be local (and not remote) ones in the mirror\nrepo.\n\nthanks,\n- VMiklos\n"},{"id":"62420","messageId":"20071208165657.GC2844@xp.machine.xx","threadId":"11183","inReplyTo":"20071208141449.GH3199@genesis.frugalware.org","subject":"Re: git-svn branch naming question","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2007-12-08T16:56:57Z","receivedAt":"2007-12-08T16:56:57Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Sat, Dec 08, 2007 at 03:14:49PM +0100, Miklos Vajna wrote:\n> On Sat, Dec 08, 2007 at 11:59:01AM +0100, Peter Baumann <waste.manager@gmx.de> wrote:\n> > Look up  --prefix in the manpage for git-svn.\n> \n> great, --prefix is what i missed.\n> \n> a related question: is it possible to avoid even the \"remotes\" prefix?\n> \n> it could be useful when creating an incremental import of an svn repo.\n> (ie when using git-svn as a replacement of git-svnimport.)\n> \n\ngit svn init --stdlayout creates this entry in your .git/config per default\n\n  [svn-remote \"svn\"]\n        url = https://url/to/your/svn/repo\n        fetch = trunk:refs/remotes/trunk\n        branches = branches/*:refs/remotes/*\n        tags = tags/*:refs/remotes/tags/*\n\nYou could change this to\n\n  [svn-remote \"svn\"]\n        url = https://url/to/your/svn/repo\n        fetch = trunk:refs/remotes/origin/trunk\n        branches = branches/*:refs/remotes/origin/*\n        tags = tags/*:refs/remotes/origin/tags/*\n\nto get what --prefix origin would do.\n\n\n On the other hand you could forget completly the remote part by specifying\n\n  [svn-remote \"svn\"]\n        url = https://url/to/your/svn/repo\n        fetch = trunk:refs/heads/trunk\n        branches = branches/*:refs/heads/*\n        tags = tags/*:refs/heads/tags/*\n\nbut I advice you to not do this. refs/remotes has a special meaning in git,\ne.g.  you can't commit directly to it (which makes sense, because it only\ntracks the state of the remote repo. On the other hand remote branches won't\nget cloned per default.)\n\nSide note, if you want to track only some branches, or if you have a strange\nsvn layout, you could use something like this:\n\n  [svn-remote \"svn\"]\n        url = https://url/to/your/svn/repo\n        fetch = trunk:refs/remotes/origin/trunk\n        fetch = branches/branchA:refs/remotes/origin/branchA\n        fetch = branches/branchB:refs/remotes/origin/branchB\n\t...\n\n\n-Peter\n"},{"id":"62440","messageId":"20071208235248.GK3199@genesis.frugalware.org","threadId":"11183","inReplyTo":"20071208165657.GC2844@xp.machine.xx","subject":"Re: git-svn branch naming question","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-12-08T23:52:48Z","receivedAt":"2007-12-08T23:52:48Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sat, Dec 08, 2007 at 05:56:57PM +0100, Peter Baumann <waste.manager@gmx.de> wrote:\n>  On the other hand you could forget completly the remote part by specifying\n> \n>   [svn-remote \"svn\"]\n>         url = https://url/to/your/svn/repo\n>         fetch = trunk:refs/heads/trunk\n>         branches = branches/*:refs/heads/*\n>         tags = tags/*:refs/heads/tags/*\n> \n> but I advice you to not do this. refs/remotes has a special meaning in git,\n> e.g.  you can't commit directly to it (which makes sense, because it only\n> tracks the state of the remote repo. On the other hand remote branches won't\n> get cloned per default.)\n\nyes, that's exactly what i want to do - in case the target is to convert\nan svn repo to a git one (and i need git-svn since git-svnimport is to\nbe removed in 1.5.4)\n\nthanks,\n- VMiklos\n"},{"id":"62444","messageId":"20071209020510.GM3199@genesis.frugalware.org","threadId":"11183","inReplyTo":"20071208235248.GK3199@genesis.frugalware.org","subject":"Re: git-svn branch naming question","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-12-09T02:05:10Z","receivedAt":"2007-12-09T02:05:10Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sun, Dec 09, 2007 at 12:52:48AM +0100, Miklos Vajna <vmiklos@frugalware.org> wrote:\n> >   [svn-remote \"svn\"]\n> >         url = https://url/to/your/svn/repo\n> >         fetch = trunk:refs/heads/trunk\n> >         branches = branches/*:refs/heads/*\n> >         tags = tags/*:refs/heads/tags/*\n> > \n> > but I advice you to not do this. refs/remotes has a special meaning in git,\n> > e.g.  you can't commit directly to it (which makes sense, because it only\n> > tracks the state of the remote repo. On the other hand remote branches won't\n> > get cloned per default.)\n> \n> yes, that's exactly what i want to do - in case the target is to convert\n> an svn repo to a git one (and i need git-svn since git-svnimport is to\n> be removed in 1.5.4)\n\nhm, this seem to be not-working for me.\n\nafter \"git svn init -s url\" i edited the config:\n\n$ cat .git/config\n[core]\n        repositoryformatversion = 0\n        filemode = true\n        bare = false\n        logallrefupdates = true\n[svn-remote \"svn\"]\n        url = svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build\n        fetch = trunk:refs/master\n        branches = branches/*:refs/*\n        tags = tags/*:refs/tags/*\n\nand wanted to fetch the revisions, but actually\n\n$ git svn fetch\n\ndoes not fetch any revisions. (yes, it does once i put back the\n\"remotes\" prefix). is this a bug? :)\n\nthanks,\n- VMiklos\n"},{"id":"62445","messageId":"20071209021336.GA8327@atjola.homenet","threadId":"11183","inReplyTo":"20071209020510.GM3199@genesis.frugalware.org","subject":"Re: git-svn branch naming question","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2007-12-09T02:13:36Z","receivedAt":"2007-12-09T02:13:36Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2007.12.09 03:05:10 +0100, Miklos Vajna wrote:\n> On Sun, Dec 09, 2007 at 12:52:48AM +0100, Miklos Vajna <vmiklos@frugalware.org> wrote:\n> > >   [svn-remote \"svn\"]\n> > >         url = https://url/to/your/svn/repo\n> > >         fetch = trunk:refs/heads/trunk\n                                 ^^^^^\n> > >         branches = branches/*:refs/heads/*\n                                         ^^^^^\n> > >         tags = tags/*:refs/heads/tags/*\n                                 ^^^^^\n\n>         url = svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build\n>         fetch = trunk:refs/master\n>         branches = branches/*:refs/*\n>         tags = tags/*:refs/tags/*\n\nJust a guess, but this seems pretty headless ;-)\n\nBjörn\n\n> and wanted to fetch the revisions, but actually\n> \n> $ git svn fetch\n> \n> does not fetch any revisions. (yes, it does once i put back the\n> \"remotes\" prefix). is this a bug? :)\n> \n> thanks,\n> - VMiklos\n"},{"id":"62448","messageId":"20071209022505.GO3199@genesis.frugalware.org","threadId":"11183","inReplyTo":"20071209021336.GA8327@atjola.homenet","subject":"Re: git-svn branch naming question","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-12-09T02:25:06Z","receivedAt":"2007-12-09T02:25:06Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sun, Dec 09, 2007 at 03:13:36AM +0100, Björn Steinbrink <B.Steinbrink@gmx.de> wrote:\n> >         url = svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build\n> >         fetch = trunk:refs/master\n> >         branches = branches/*:refs/*\n> >         tags = tags/*:refs/tags/*\n> \n> Just a guess, but this seems pretty headless ;-)\n\noh, right. here is my fixed config:\n\n[svn-remote \"svn\"]\n        url = svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build\n        fetch = trunk:refs/heads/master\n        branches = branches/*:refs/heads/*\n        tags = tags/*:refs/tags/*\n\ngit svn fetch still does not seem to do anything :S\n\nthanks,\n- VMiklos\n"},{"id":"62449","messageId":"20071209022624.GA31033@soma","threadId":"11183","inReplyTo":"20071209020510.GM3199@genesis.frugalware.org","subject":"Re: git-svn branch naming question","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-12-09T02:26:24Z","receivedAt":"2007-12-09T02:26:24Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Miklos Vajna <vmiklos@frugalware.org> wrote:\n> On Sun, Dec 09, 2007 at 12:52:48AM +0100, Miklos Vajna <vmiklos@frugalware.org> wrote:\n> > >   [svn-remote \"svn\"]\n> > >         url = https://url/to/your/svn/repo\n> > >         fetch = trunk:refs/heads/trunk\n> > >         branches = branches/*:refs/heads/*\n> > >         tags = tags/*:refs/heads/tags/*\n> > > \n> > > but I advice you to not do this. refs/remotes has a special meaning in git,\n> > > e.g.  you can't commit directly to it (which makes sense, because it only\n> > > tracks the state of the remote repo. On the other hand remote branches won't\n> > > get cloned per default.)\n> > \n> > yes, that's exactly what i want to do - in case the target is to convert\n> > an svn repo to a git one (and i need git-svn since git-svnimport is to\n> > be removed in 1.5.4)\n> \n> hm, this seem to be not-working for me.\n> \n> after \"git svn init -s url\" i edited the config:\n> \n> $ cat .git/config\n> [core]\n>         repositoryformatversion = 0\n>         filemode = true\n>         bare = false\n>         logallrefupdates = true\n> [svn-remote \"svn\"]\n>         url = svn+ssh://vmiklos@svn.gnome.org/svn/ooo-build\n>         fetch = trunk:refs/master\n>         branches = branches/*:refs/*\n>         tags = tags/*:refs/tags/*\n> \n> and wanted to fetch the revisions, but actually\n> \n> $ git svn fetch\n> \n> does not fetch any revisions. (yes, it does once i put back the\n> \"remotes\" prefix). is this a bug? :)\n\nI'm not sure if it's considered a \"bug\", but that's just the\nway it is at the moment.  I can't remember why, but I did\nmake git-svn force the presence of the \"remotes/\" prefix\nin all refs it writes to...\n\n-- \nEric Wong\n"},{"id":"62451","messageId":"20071209023600.GP3199@genesis.frugalware.org","threadId":"11183","inReplyTo":"20071209022624.GA31033@soma","subject":"Re: git-svn branch naming question","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-12-09T02:36:00Z","receivedAt":"2007-12-09T02:36:00Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sat, Dec 08, 2007 at 06:26:24PM -0800, Eric Wong <normalperson@yhbt.net> wrote:\n> I'm not sure if it's considered a \"bug\", but that's just the\n> way it is at the moment.  I can't remember why, but I did\n> make git-svn force the presence of the \"remotes/\" prefix\n> in all refs it writes to...\n\nokay, i see. one problem: git-svnimport is to be removed and (afaik) the\nsupposed way is to use git-svn instead. what is the supposed way to use\ngit-svn to convert an svn repo to a git one if the method i tried is not\nworking?\n\n(if the branches are fetched to \"remotes/\" then they won't be visible\nwhen one clones the converted repo)\n\nthanks,\n- VMiklos\n"},{"id":"62453","messageId":"20071209032608.GB31033@soma","threadId":"11183","inReplyTo":"20071209023600.GP3199@genesis.frugalware.org","subject":"Re: git-svn branch naming question","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-12-09T03:26:08Z","receivedAt":"2007-12-09T03:26:08Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Miklos Vajna <vmiklos@frugalware.org> wrote:\n> On Sat, Dec 08, 2007 at 06:26:24PM -0800, Eric Wong <normalperson@yhbt.net> wrote:\n> > I'm not sure if it's considered a \"bug\", but that's just the\n> > way it is at the moment.  I can't remember why, but I did\n> > make git-svn force the presence of the \"remotes/\" prefix\n> > in all refs it writes to...\n> \n> okay, i see. one problem: git-svnimport is to be removed and (afaik) the\n> supposed way is to use git-svn instead. what is the supposed way to use\n> git-svn to convert an svn repo to a git one if the method i tried is not\n> working?\n> \n> (if the branches are fetched to \"remotes/\" then they won't be visible\n> when one clones the converted repo)\n\nI'm pretty sure the reasoning behind \"remotes/\" being forced by git-svn\nwas to prevent users from shooting themselves in the foot, since\ncommitting to those remote refs will break both git-svn fetch and\ndcommit...\n\nHeck, the entire \"remotes/\" idea started because a git-svn user made the\nmistake of committing to the remote tracking branch directly:\n\n  http://thread.gmane.org/gmane.comp.version-control.git/16869/focus=16875\n\nI'll consider accepting a patch to lift that restriction (but still use\nthe \"remotes/\" by default, of course).\n\n\nAlso, it's possible to fetch them after editing .git/config a little:\n\n  Harvey Harrison's \"[RFC] Mirroring svn\" post has a good example\n  on how to do it.\n\n  http://mid.gmane.org/1196922153.10408.101.camel@brick\n\nPerhaps git-clone could gain the ability to clone refs/remotes/ as-is\nwithout an extra step?\n\n-- \nEric Wong\n"},{"id":"62456","messageId":"1197177369.32435.1.camel@brick","threadId":"11183","inReplyTo":"20071209032608.GB31033@soma","subject":"Re: git-svn branch naming question","fromName":"Harvey Harrison","fromEmail":"harvey.harrison@gmail.com","sentAt":"2007-12-09T05:16:09Z","receivedAt":"2007-12-09T05:16:09Z","isPatch":false,"sender":{"key":"harvey.harrison@gmail.com","avatar":null},"body":"On Sat, 2007-12-08 at 19:26 -0800, Eric Wong wrote:\n\n> \n> Perhaps git-clone could gain the ability to clone refs/remotes/ as-is\n> without an extra step?\n> \n\nSomething in the spirit of --mirror perhaps?  \n\n--mirror-remotes sounds about right\n\nHarvey\n"},{"id":"62515","messageId":"20071209193633.GR3199@genesis.frugalware.org","threadId":"11183","inReplyTo":"20071209032608.GB31033@soma","subject":"Re: git-svn branch naming question","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-12-09T19:36:33Z","receivedAt":"2007-12-09T19:36:33Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sat, Dec 08, 2007 at 07:26:08PM -0800, Eric Wong <normalperson@yhbt.net> wrote:\n> Perhaps git-clone could gain the ability to clone refs/remotes/ as-is\n> without an extra step?\n\nwell, what i did for now is to use 2 repos. i use git-svn to create a\nregular git-svn repo from svn, then an other one to create a regular git\nrepo from the git-svn one. this has one benefit: git-svn requires a\nworking tree, but i definitely want to publish only a bare repo. so here\nis what i have in the bare repo's config:\n\n[remote \"origin\"]\n        url = /path/to/git-svn/repo\n        fetch = +refs/remotes/origin/tags/*:refs/tags/*\n        fetch = +refs/remotes/origin/trunk:refs/heads/master\n        fetch = +refs/remotes/origin/*:refs/heads/*\n\nthen a simple git fetch will do what i need. i'm not entirely sure this\nis the right think to do, but works for me :)\n\nthanks,\n- VMiklos\n"}]}