{"thread":{"id":"14463","subject":"Standard \"git svn init ; git svn fetch\" behavior","startedAt":"2008-07-15T11:24:00Z","lastAt":"2008-07-15T20:14:15Z","messageCount":3,"participants":["Peter Valdemar Mørch (Lists)","Peter Harris"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"83387","messageId":"487C88D0.30609@sneakemail.com","threadId":"14463","inReplyTo":null,"subject":"Standard \"git svn init ; git svn fetch\" behavior","fromName":"Peter Valdemar Mørch (Lists)","fromEmail":"4ux6as402@sneakemail.com","sentAt":"2008-07-15T11:24:00Z","receivedAt":"2008-07-15T11:24:00Z","isPatch":false,"sender":{"key":"4ux6as402@sneakemail.com","avatar":null},"body":"Hi,\n\nI've now converted my svn repos to git with\n\n$ git-svn init -T trunk -t tags -b branches file://some/path\n$ git svn fetch\n\nWonderful!\n\nI have two questions about the result:\n\n1) It seems the svn tags were converted into git branches such as \n\"tags/mytag\". Is that normal?\n\n2) Why does master end up being off of tags/mytag instead of off of trunk?\n\n###################################\nRe: 1) It seems the svn tags were converted into git branches such as \n\"tags/mytag\". Is that normal?\n###################################\n\n$ git tag -l\nreturns nothing and\n$ git branch -a\nreturns all my svn tags as \"tags/<tag>\" git branches and all my svn \nbranches as expected in \"the root\".\n\nIs that by design? Are there any downsides of creating a script that\n\nforeach $tag ( m|tags/(.*)| ) {\n   git tag $tag $tag\n   git branch -r -D $tag\n}\n\nI'm cool with doing that, I just wanted to know if this is the expected \nbehaviour, and/or whether I'll run into trouble later because of a \nwierdly converted subversion repository.\n\n\n###################################\nRe: 2) Why does master end up being off of tags/mytag instead of off of \ntrunk?\n###################################\n\nI would have expected, that \"master\" ended up tracking \"trunk\", and not \ntags/mytag. Why track an obscure tag instead of trunk?\n\nThe tail of the fetch:\n\nSuccessfully followed parent\nW: +empty_dir: tags/mytag/probe/userHomedir/foo/cache/zlcache\nW: +empty_dir: tags/mytag/probe/userHomedir/foo/pna_menu_items\nr7375 = 5d3012afabccd348a5a5b81c5cf28532d324ea1b (tags/mytag)\nChecking out files: 100% (2184/2184), done.\nChecked out HEAD:\n   file:///home/pvm/cm/repos/tags/mytag r7375\n\n(\"mytag\" and \"foo\" replaced internal identifiers present in real output...)\n\n$ git log --pretty=oneline --decorate -n 1\n\n5d3012afabccd348a5a5b81c5cf28532d324ea1b (refs/remotes/tags/mytag, \nrefs/heads/master) Tag mytag\n\nI rectified it with simply\n\n$ git branch -m master old\n$ git checkout -b master trunk\n$ git branch -d old\n\nJust wondering: Why is this behaviour the default? Is it a bug?\n\nIs there a smarter way to find out what branchpoint was used to create \n\"master\"? (I'm new to git, and find it difficult to see what my branches \nwere \"made from\")\n\nPeter\n\n-- \nPeter Valdemar Mørch\nhttp://www.morch.com\n"},{"id":"83395","messageId":"eaa105840807150737u11b02f50xba2c8201ce96eec0@mail.gmail.com","threadId":"14463","inReplyTo":"487C88D0.30609@sneakemail.com","subject":"Re: Standard \"git svn init ; git svn fetch\" behavior","fromName":"Peter Harris","fromEmail":"git@peter.is-a-geek.org","sentAt":"2008-07-15T14:37:32Z","receivedAt":"2008-07-15T14:37:32Z","isPatch":false,"sender":{"key":"git@peter.is-a-geek.org","avatar":null},"body":"On Tue, Jul 15, 2008 at 7:24 AM, \"Peter Valdemar Mørch (Lists)\" wrote:\n>\n> 1) It seems the svn tags were converted into git branches such as\n> \"tags/mytag\". Is that normal?\n\nYes.\n\nSubversion doesn't really have tags. They're just branches with 'tag'\nin the name. git-svn wants them to be branches on the git side so that\nit can track future commits to the 'tag'.\n\n> Re: 2) Why does master end up being off of tags/mytag instead of off of\n> trunk?\n>\n> I would have expected, that \"master\" ended up tracking \"trunk\", and not\n> tags/mytag. Why track an obscure tag instead of trunk?\n\nSome projects work on trunk and keep a maint branch. Some projects\nwork on branches, and only merge bug fixes to trunk. To facilitate\nthis model, git-svn tries to guess which branch is your working\nbranch, and picks that one to be master.\n\nIn this case, you were unlucky enough to have the most recent commit\nbe on a tag-branch.\n\n> Is there a smarter way to find out what branchpoint was used to create\n> \"master\"? (I'm new to git, and find it difficult to see what my branches\n> were \"made from\")\n\nGit doesn't know what any particular branch was \"made from\", as the\nbranch point in question may be an ancestor of any number of other\nbranches.\n\ngit-svn does keep track of the subversion branch you are working on.\n\"git svn info\"\n\nPeter Harris\n"},{"id":"83427","messageId":"487D0517.2030107@sneakemail.com","threadId":"14463","inReplyTo":"eaa105840807150737u11b02f50xba2c8201ce96eec0@mail.gmail.com","subject":"Re: Standard \"git svn init ; git svn fetch\" behavior","fromName":"Peter Valdemar Mørch (Lists)","fromEmail":"4ux6as402@sneakemail.com","sentAt":"2008-07-15T20:14:15Z","receivedAt":"2008-07-15T20:14:15Z","isPatch":false,"sender":{"key":"4ux6as402@sneakemail.com","avatar":null},"body":"Peter, thanks for your swift reply! It cleared up things for me.\n"}]}